mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
utilize int.from_bytes
This commit is contained in:
parent
da0bea213d
commit
1221f6b603
1 changed files with 1 additions and 1 deletions
|
@ -147,7 +147,7 @@ class UUID(object):
|
||||||
if len(bytes) != 16:
|
if len(bytes) != 16:
|
||||||
raise ValueError('bytes is not a 16-char string')
|
raise ValueError('bytes is not a 16-char string')
|
||||||
assert isinstance(bytes, bytes_), repr(bytes)
|
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 fields is not None:
|
||||||
if len(fields) != 6:
|
if len(fields) != 6:
|
||||||
raise ValueError('fields is not a 6-tuple')
|
raise ValueError('fields is not a 6-tuple')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue