summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/sys_exit.py
blob: 4994af4161c1f98943cc4157bb85948a4e5dd006 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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)