Skip to content

Commit

Permalink
Allow 'compiled' formats for unpack()
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Jan 7, 2016
1 parent 2d4f652 commit 53fd50c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bitstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ def unpack(fmt, data):
"""

bits = ''.join(['{:08b}'.format(b) for b in data])
infos = _parse_format(fmt)
if not isinstance(fmt, list):
infos = _parse_format(fmt)
else:
infos = fmt
res = []
i = 0

Expand Down

0 comments on commit 53fd50c

Please sign in to comment.