[Python-Dev] AtExit Functions

Skip Montanaro skip@pobox.com
Mon, 15 Jul 2002 07:43:37 -0500


    mal> I suppose the first one is what the atexit module exposes in Python
    mal> 2.0+, right ?

Not really.  The atexit module is just a wrapper around sys.exitfunc which
provides a standard protocol for registering more than one function to be
called at exit.  You should be able to easily backport it to 1.5.2 and
deliver it with your package for installation on systems still running
1.5.2.  Or, just deal directly with sys.exitfunc.  Before 2.0 there was no
rational way to use sys.exitfunc.  The application, libraries, and core code
had no rules about who could or couldn't set sys.exitfunc.

Skip