Milan Rossa
5 years ago
committed by
Damien George
2 changed files with 20 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||
# test sys.atexit() function |
|||
|
|||
import sys |
|||
try: |
|||
sys.atexit |
|||
except AttributeError: |
|||
print('SKIP') |
|||
raise SystemExit |
|||
|
|||
some_var = None |
|||
|
|||
def do_at_exit(): |
|||
print("done at exit:", some_var) |
|||
|
|||
sys.atexit(do_at_exit) |
|||
|
|||
some_var = "ok" |
|||
print("done before exit") |
@ -0,0 +1,2 @@ |
|||
done before exit |
|||
done at exit: ok |
Loading…
Reference in new issue