2019-10-29 07:16:19 -04:00
|
|
|
# test sys module's exit function
|
|
|
|
|
2022-08-18 02:57:45 -04:00
|
|
|
import sys
|
2019-10-29 07:16:19 -04:00
|
|
|
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)
|