papi: remove python2 patterns
Type: refactor
Change-Id: I541759b4b788acf08599661eb9e7abc58e9283d2
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index d31a0bb..81ce53e 100644
--- a/src/vpp-api/python/vpp_papi/vpp_serializer.py
+++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py
@@ -29,10 +29,9 @@
#
logger = logging.getLogger('vpp_papi.serializer')
-if sys.version[0] == '2':
- def check(d): type(d) is dict
-else:
- def check(d): type(d) is dict or type(d) is bytes
+
+def check(d):
+ return type(d) is dict or type(d) is bytes
def conversion_required(data, field_type):
@@ -57,8 +56,7 @@
return vpp_format.conversion_unpacker_table[field_type](data)
-# TODO: post 20.01, remove inherit from object.
-class Packer(object):
+class Packer:
options = {}
def pack(self, data, kwargs):
@@ -384,9 +382,6 @@
def __bool__(self):
return True
- # TODO: Remove post 20.01.
- if sys.version[0] == '2':
- __nonzero__ = __bool__
def pack(self, data, kwargs=None):
if data is None: # Default to zero if not specified