We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3180113 commit 80a86c4Copy full SHA for 80a86c4
2 files changed
…sts/micropython/import_mpy_native_x64.py tests/micropython/import_mpy_native.pytests/micropython/import_mpy_native_x64.py renamed to tests/micropython/import_mpy_native.py
@@ -1,15 +1,17 @@
1
-# test importing of .mpy files with native code (x64 only)
+# test importing of .mpy files with native code
2
3
try:
4
import usys, uio, uos
5
6
+ usys.implementation._mpy
7
uio.IOBase
8
uos.mount
9
except (ImportError, AttributeError):
10
print("SKIP")
11
raise SystemExit
12
-if not (usys.platform == "linux" and usys.maxsize > 2**32):
13
+mpy_arch = usys.implementation._mpy >> 8
14
+if mpy_arch == 0:
15
16
17
@@ -49,15 +51,14 @@ def open(self, path, mode):
49
51
50
52
53
# these are the test .mpy files
54
+valid_header = bytes([77, 6, mpy_arch, 31])
55
# fmt: off
56
user_files = {
57
# bad architecture
- '/mod0.mpy': b'M\x06\xfc\x00\x10',
58
+ '/mod0.mpy': b'M\x06\xfc\x1f',
59
60
# test loading of viper and asm
- '/mod1.mpy': (
- b'M\x06\x08\x1f' # header
-
61
+ '/mod1.mpy': valid_header + (
62
b'\x02' # n_qstr
63
b'\x00' # n_obj
64
@@ -84,9 +85,7 @@ def open(self, path, mode):
84
85
),
86
87
# test loading viper with additional scope flags and relocation
- '/mod2.mpy': (
88
89
+ '/mod2.mpy': valid_header + (
90
91
92
…micropython/import_mpy_native_x64.py.exp …sts/micropython/import_mpy_native.py.exptests/micropython/import_mpy_native_x64.py.exp renamed to tests/micropython/import_mpy_native.py.exp
0 commit comments