[Python-3000] Removing sys.exitfunc

Collin Winter collinw at gmail.com
Fri Mar 9 04:03:09 CET 2007


I was revisiting my patch on SF to remove sys.exitfunc (per PEP 3100),
and I found some usages in the stdlib I had missed the first time
around. One of these, I was surprised to learn, is atexit.py; in fact,
atexit is implemented in terms of sys.exitfunc. This was especially
shocking because PEP 3100 cites that you should "use [the] atexit
module instead" of sys.exitfunc as an argument for the latter's
deletion.

Suggestions, anyone, on how to remove sys.exitfunc and keep atexit
working? My own would be to replace atexit.py with a C module that
allows manipulation of the exitfuncs array in Python/pythonrun.c (or
something similar).

Collin Winter


More information about the Python-3000 mailing list