summaryrefslogtreecommitdiff
path: root/tests/cmdline/cmd_module_atexit.py
blob: 100bc112777e11b465a1325282fc1f8e8c51b335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# cmdline: -m cmdline.cmd_module_atexit
#
# Test running as a module and using sys.atexit.

import sys

if not hasattr(sys, "atexit"):
    print("SKIP")
    raise SystemExit

# Verify we ran as a module.
print(sys.argv)

sys.atexit(lambda: print("done"))

print("start")