summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/sys_exit.py
blob: b1f71549db1c5b70093b1e5a1c390ef862df8f56 (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
24
# 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)