Skip to content

Commit

Permalink
Add support for multi-bit flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bikovitsky authored and arekbulski committed Mar 30, 2018
1 parent b1d9c1f commit 26261c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion construct/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ def _decode(self, obj, context, path):
obj2 = Container()
obj2._flagsenum = True
for name,value in self.flags.items():
obj2[BitwisableString(name)] = bool(obj & value)
obj2[BitwisableString(name)] = (obj & value == value)
return obj2

def _encode(self, obj, context, path):
Expand Down

0 comments on commit 26261c4

Please sign in to comment.