Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
32dcd3b
)
papi: update VPPEnumType for python3
51/20551/2
author
Paul Vinciguerra
<
[email protected]
>
Mon, 8 Jul 2019 19:41:07 +0000
(15:41 -0400)
committer
Neale Ranns
<
[email protected]
>
Tue, 9 Jul 2019 07:13:21 +0000
(07:13 +0000)
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 <
[email protected]
>
src/vpp-api/python/vpp_papi/vpp_serializer.py
patch
|
blob
|
history
diff --git
a/src/vpp-api/python/vpp_papi/vpp_serializer.py
b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index
9e17c4a
..
7c7f331
100644
(file)
--- 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)