Skip to content

Commit

Permalink
Fixed sizeof
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Aug 29, 2016
1 parent 553baae commit 3234c56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions construct/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ def _build(self, obj, stream, context):
(self.mincount, self.maxcount, len(obj)), sys.exc_info()[1])

def _sizeof(self, context):
if context is None:
raise SizeofError("cannot calculate size")
if not len(context) <= self.mincount <= self.maxcout <= len(context):
raise SizeofError("expected between %d and %d, but found %d" %
(self.mincount, self.maxcout, len(context)))
Expand Down

0 comments on commit 3234c56

Please sign in to comment.