Skip to content
Snippets Groups Projects
Select Git revision
0 results

runtime.c

  • Milan Rossa's avatar
    cb364700
    py: Implement new sys.atexit feature. · cb364700
    Milan Rossa authored
    This patch implements a new sys.atexit function which registers a function
    that is later executed when the main script ends.  It is configurable via
    MICROPY_PY_SYS_ATEXIT, disabled by default.
    
    This is not compliant with CPython, rather it can be used to implement a
    CPython compatible "atexit" module if desired (similar to how
    sys.print_exception can be used to implement functionality of the
    "traceback" module).
    cb364700
    History
    py: Implement new sys.atexit feature.
    Milan Rossa authored
    This patch implements a new sys.atexit function which registers a function
    that is later executed when the main script ends.  It is configurable via
    MICROPY_PY_SYS_ATEXIT, disabled by default.
    
    This is not compliant with CPython, rather it can be used to implement a
    CPython compatible "atexit" module if desired (similar to how
    sys.print_exception can be used to implement functionality of the
    "traceback" module).