Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Woazboat
firmware
Commits
0a12dc75
Verified
Commit
0a12dc75
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
fix(pycardium): Actually enable UUID module
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
ec12a3cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycardium/modules/py/meson.build
+1
-0
1 addition, 0 deletions
pycardium/modules/py/meson.build
pycardium/modules/py/uuid.py
+3
-2
3 additions, 2 deletions
pycardium/modules/py/uuid.py
with
4 additions
and
2 deletions
pycardium/modules/py/meson.build
+
1
−
0
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
)
This diff is collapsed.
Click to expand it.
pycardium/modules/py/uuid.py
+
3
−
2
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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment