Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
de575c80
Commit
de575c80
authored
Jul 06, 2015
by
Paul Sokolovsky
Browse files
tools/make-frozen.py: Actually make Python2-compatible.
parent
3a2e9f20
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/make-frozen.py
View file @
de575c80
#!/usr/bin/env python
#!/usr/bin/env python
3
#
# Create frozen modules structure for MicroPython.
#
...
...
@@ -49,7 +49,11 @@ for f, st in modules:
m
=
module_name
(
f
)
print
(
'"%s
\\
0"'
%
m
)
data
=
open
(
sys
.
argv
[
1
]
+
"/"
+
f
,
"rb"
).
read
()
data
=
repr
(
data
)[
2
:
-
1
]
# Python2 vs Python3 tricks
data
=
repr
(
data
)
if
data
[
0
]
==
"b"
:
data
=
data
[
1
:]
data
=
data
[
1
:
-
1
]
data
=
data
.
replace
(
'"'
,
'
\\
"'
)
print
(
'"%s"'
%
data
)
print
(
"};"
)
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