diff options
| author | Milan Rossa | 2019-08-05 15:11:24 +0200 |
|---|---|---|
| committer | Damien George | 2019-08-15 17:31:04 +1000 |
| commit | 6f0c6bd77410ad25ade6a3999c62451ae76ea60a (patch) | |
| tree | a851fcb48307d0c4ab791dd5fd9dcda48a1d8b5e /ports/unix/main.c | |
| parent | cb3647004fbf7b069a3509a02b72420828369bd3 (diff) | |
unix: Enable sys.atexit, triggered after the main script ends.
Diffstat (limited to 'ports/unix/main.c')
| -rw-r--r-- | ports/unix/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/unix/main.c b/ports/unix/main.c index cd2dc49a5..004d581bb 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -642,6 +642,12 @@ MP_NOINLINE int main_(int argc, char **argv) { } } + #if MICROPY_PY_SYS_ATEXIT + if (mp_obj_is_callable(MP_STATE_VM(sys_exitfunc))) { + mp_call_function_0(MP_STATE_VM(sys_exitfunc)); + } + #endif + #if MICROPY_PY_MICROPYTHON_MEM_INFO if (mp_verbose_flag) { mp_micropython_mem_info(0, NULL); |
