[Python-checkins] CVS: python/dist/src/Lib atexit.py,1.3,1.4

Tim Peters tim_one@users.sourceforge.net
Sat, 20 Jan 2001 19:40:39 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15905/python/dist/src/Lib

Modified Files:
	atexit.py 
Log Message:
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.


Index: atexit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/atexit.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** atexit.py	2001/01/20 19:54:20	1.3
--- atexit.py	2001/01/21 03:40:37	1.4
***************
*** 17,23 ****
  
      while _exithandlers:
!         func, targs, kargs = _exithandlers[-1]
          apply(func, targs, kargs)
-         _exithandlers.remove(_exithandlers[-1])
  
  def register(func, *targs, **kargs):
--- 17,22 ----
  
      while _exithandlers:
!         func, targs, kargs = _exithandlers.pop()
          apply(func, targs, kargs)
  
  def register(func, *targs, **kargs):