From: Andrey "Zed" Zaikin Date: Thu, 12 Apr 2018 09:14:02 +0000 (+0300) Subject: fixes python3 TypeError; python2 intact X-Git-Tag: v18.07-rc1~482 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=7fe930b73f28bb62c26a4bfbe3871d684c045706;p=vpp.git fixes python3 TypeError; python2 intact exception in vpp_api.vac_write(): "TypeError: initializer for ctype 'char *' must be a bytes or list or tuple, not str" Change-Id: Ib6bcfb86e6e36c557174979a110113af689c6754 Signed-off-by: Andrey "Zed" Zaikin --- diff --git a/src/vpp-api/python/vpp_papi.py b/src/vpp-api/python/vpp_papi.py index 35edd491085..5fa82a30acb 100644 --- a/src/vpp-api/python/vpp_papi.py +++ b/src/vpp-api/python/vpp_papi.py @@ -639,7 +639,7 @@ class VPP(): """Send a binary-packed message to VPP.""" if not self.connected: raise IOError(1, 'Not connected') - return vpp_api.vac_write(str(buf), len(buf)) + return vpp_api.vac_write(bytes(buf), len(buf)) def _read(self): if not self.connected: