Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Haun
firmware
Commits
0a12dc75
Verified
Commit
0a12dc75
authored
Sep 03, 2019
by
Rahix
Browse files
fix(pycardium): Actually enable UUID module
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
ec12a3cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
pycardium/modules/py/meson.build
View file @
0a12dc75
...
...
@@ -20,6 +20,7 @@ python_modules = files(
'string.py',
'struct.py',
'ucontextlib.py',
'uuid.py',
)
frozen_modules = mpy_cross.process(python_modules)
pycardium/modules/py/uuid.py
View file @
0a12dc75
...
...
@@ -20,7 +20,7 @@ class UUID:
if
len
(
bytes
)
!=
16
:
raise
ValueError
(
"bytes is not a 16-char string"
)
assert
isinstance
(
bytes
,
bytes_
),
repr
(
bytes
)
int
=
int_
.
from_bytes
(
bytes
,
byteorder
=
"big"
)
int
=
int_
.
from_bytes
(
bytes
,
"big"
)
if
int
is
not
None
:
if
not
0
<=
int
<
1
<<
128
:
raise
ValueError
(
"int is out of range (need a 128-bit value)"
)
...
...
@@ -33,7 +33,8 @@ class UUID:
# Set the version number.
int
&=
~
(
0xF000
<<
64
)
int
|=
version
<<
76
self
.
__dict__
[
"int"
]
=
int
setattr
(
self
,
"int"
,
int
)
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
UUID
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment