micropython: add micropython component
This commit is contained in:
21
components/language/micropython/tests/misc/sys_atexit.py
Normal file
21
components/language/micropython/tests/misc/sys_atexit.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# test sys.atexit() function
|
||||
|
||||
import usys
|
||||
|
||||
try:
|
||||
usys.atexit
|
||||
except AttributeError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
some_var = None
|
||||
|
||||
|
||||
def do_at_exit():
|
||||
print("done at exit:", some_var)
|
||||
|
||||
|
||||
usys.atexit(do_at_exit)
|
||||
|
||||
some_var = "ok"
|
||||
print("done before exit")
|
Reference in New Issue
Block a user