aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-07-08 15:41:07 -0400
committerNeale Ranns <nranns@cisco.com>2019-07-09 07:13:21 +0000
commita089ae1294c8a49555fd95a905e2caa04cb7f900 (patch)
treeb1e28efdcea55badfabd01bf51dad7531628ab7f /src
parent32dcd3b2f227dec638c39ade0c58d6741d83ec30 (diff)
papi: update VPPEnumType for python3
Python3 uses __bool__ instead of __nonzero__ Type: fix Depends-on: https://gerrit.fd.io/r/#/c/20484/ Change-Id: I7dd13d0508ab18d6c50c235f4186006799e92b45 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src')
-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)