circuitpython/tests/basics/sys_exit.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
365 B
Python
Raw Permalink Normal View History

# 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)