Browse Source
This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".pull/6398/head
stijn
4 years ago
committed by
Damien George
46 changed files with 142 additions and 89 deletions
@ -1,6 +1,6 @@ |
|||
# uPy behaviour only: builtin modules are read-only |
|||
import sys |
|||
import usys |
|||
try: |
|||
sys.x = 1 |
|||
usys.x = 1 |
|||
except AttributeError: |
|||
print("AttributeError") |
|||
|
@ -1,3 +1,6 @@ |
|||
import sys |
|||
try: |
|||
import usys as sys |
|||
except ImportError: |
|||
import sys |
|||
|
|||
print(sys.byteorder) |
|||
|
@ -1,3 +1,6 @@ |
|||
import sys |
|||
try: |
|||
import usys as sys |
|||
except ImportError: |
|||
import sys |
|||
|
|||
print(sys.argv) |
|||
|
@ -1,4 +1,7 @@ |
|||
import sys |
|||
try: |
|||
import usys as sys |
|||
except ImportError: |
|||
import sys |
|||
|
|||
print(sys.stdin.fileno()) |
|||
print(sys.stdout.fileno()) |
|||
|
Loading…
Reference in new issue