mirror of
https://github.com/W3SLAV/micropython.git
synced 2025-06-20 12:35:34 -04:00

This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
24 lines
365 B
Python
24 lines
365 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)
|