micropython: add micropython component
This commit is contained in:
27
components/language/micropython/tests/basics/sys_exit.py
Normal file
27
components/language/micropython/tests/basics/sys_exit.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# test sys module's exit function
|
||||
|
||||
try:
|
||||
import usys as sys
|
||||
except ImportError:
|
||||
import sys
|
||||
|
||||
try:
|
||||
sys.exit
|
||||
except AttributeError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
try:
|
||||
raise SystemExit
|
||||
except SystemExit as e:
|
||||
print("SystemExit", e.args)
|
||||
|
||||
try:
|
||||
sys.exit()
|
||||
except SystemExit as e:
|
||||
print("SystemExit", e.args)
|
||||
|
||||
try:
|
||||
sys.exit(42)
|
||||
except SystemExit as e:
|
||||
print("SystemExit", e.args)
|
Reference in New Issue
Block a user