diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-01-21 03:40:37 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-01-21 03:40:37 (GMT) |
commit | 384fd106e89ec859ace7c098620aad8ce2c2abaa (patch) | |
tree | c64de17c61b9e6b6f9fb77853611c544e1c6ac3d /Lib | |
parent | eccd02a40d0921fc2953213e71da8a3a79d00e17 (diff) | |
download | cpython-384fd106e89ec859ace7c098620aad8ce2c2abaa.zip cpython-384fd106e89ec859ace7c098620aad8ce2c2abaa.tar.gz cpython-384fd106e89ec859ace7c098620aad8ce2c2abaa.tar.bz2 |
Bug #128475: mimetools.encode (sometimes) fails when called from a thread.
pythonrun.c: In Py_Finalize, don't reset the initialized flag until after
the exit funcs have run.
atexit.py: in _run_exitfuncs, mutate the list of pending calls in a
threadsafe way. This wasn't a contributor to bug 128475, it just burned
my eyeballs when looking at that bug.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/atexit.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/atexit.py b/Lib/atexit.py index bcf7e54..61f2458 100644 --- a/Lib/atexit.py +++ b/Lib/atexit.py @@ -16,9 +16,8 @@ def _run_exitfuncs(): """ while _exithandlers: - func, targs, kargs = _exithandlers[-1] + func, targs, kargs = _exithandlers.pop() apply(func, targs, kargs) - _exithandlers.remove(_exithandlers[-1]) def register(func, *targs, **kargs): """register a function to be executed upon normal program termination |