@@ -160,7 +160,8 @@ def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, |
|
|
160 |
160 |
raise ValueError('badly formed hexadecimal UUID string') |
161 |
161 |
int = int_(hex, 16) |
162 |
162 |
if bytes_le is not None: |
163 |
|
-if not isinstance(bytes_le, (bytes_, bytearray)): |
|
163 |
+# Don't cast int to bytes to get a TypeError above |
|
164 |
+if not isinstance(bytes_le, (bytes_, bytearray, int_)): |
164 |
165 |
bytes_le = bytes_(bytes_le) |
165 |
166 |
if len(bytes_le) != 16: |
166 |
167 |
raise ValueError('bytes_le is not a 16-char string') |