aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_serializer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index 9e17c4a2b8c..7c7f331b04c 100644
--- a/src/vpp-api/python/vpp_papi/vpp_serializer.py
+++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py
@@ -327,9 +327,12 @@ class VPPEnumType(object):
def __getattr__(self, name):
return self.enum[name]
- def __nonzero__(self):
+ def __bool__(self):
return True
+ if sys.version[0] == '2':
+ __nonzero__ = __bool__
+
def pack(self, data, kwargs=None):
return types[self.enumtype].pack(data)