mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 09:30:24 +08:00
25 lines
366 B
Python
25 lines
366 B
Python
|
# test sys module's exit function
|
||
|
|
||
|
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)
|