utilize int.from_bytes

This commit is contained in:
Philip Jenvey 2013-08-29 18:33:50 -07:00
parent da0bea213d
commit 1221f6b603

View file

@ -147,7 +147,7 @@ def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
if len(bytes) != 16:
raise ValueError('bytes is not a 16-char string')
assert isinstance(bytes, bytes_), repr(bytes)
int = int_(('%02x'*16) % tuple(bytes), 16)
int = int_.from_bytes(bytes, byteorder='big')
if fields is not None:
if len(fields) != 6:
raise ValueError('fields is not a 6-tuple')