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