X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvpp-api%2Fpython%2Fvpp_papi%2Fvpp_serializer.py;h=d62e3a4a57a56163a8918124312f90a10a3de335;hp=418c0243402bfedde012588045c5697e1917393f;hb=8006c6a;hpb=02782d6ebd13ce02f2d3facebb54fec3c2137c88 diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py index 418c0243402..d62e3a4a57a 100644 --- a/src/vpp-api/python/vpp_papi/vpp_serializer.py +++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py @@ -30,9 +30,10 @@ import socket logger = logging.getLogger(__name__) if sys.version[0] == '2': - check = lambda d: type(d) is dict + def check(d): type(d) is dict else: - check = lambda d: type(d) is dict or type(d) is bytes + def check(d): type(d) is dict or type(d) is bytes + def conversion_required(data, field_type): if check(data): @@ -101,7 +102,7 @@ class String(object): return b'', 0 p = BaseTypes('u8', length) x, size = p.unpack(data, offset + length_field_size) - x2 = x.split(b'\0',1)[0] + x2 = x.split(b'\0', 1)[0] return (x2.decode('utf8'), size + length_field_size)