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.
T
Tim Peters committed
384fd106e89ec859ace7c098620aad8ce2c2abaa
Parent: eccd02a