[Python-checkins] python/dist/src/Lib tempfile.py,1.42,1.43

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Tue, 13 Aug 2002 16:31:04 -0700


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

Modified Files:
	tempfile.py 
Log Message:
_once():  Removed obfuscating aliasing of _once_lock.


Index: tempfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/tempfile.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** tempfile.py	13 Aug 2002 23:29:21 -0000	1.42
--- tempfile.py	13 Aug 2002 23:31:02 -0000	1.43
***************
*** 99,109 ****
  
      vars = globals()
-     lock = _once_lock
- 
      # Check first outside the lock.
      if vars.get(var) is not None:
          return
      try:
!         lock.acquire()
          # Check again inside the lock.
          if vars.get(var) is not None:
--- 99,107 ----
  
      vars = globals()
      # Check first outside the lock.
      if vars.get(var) is not None:
          return
      try:
!         _once_lock.acquire()
          # Check again inside the lock.
          if vars.get(var) is not None:
***************
*** 111,115 ****
          vars[var] = initializer()
      finally:
!         lock.release()
  
  class _RandomNameSequence:
--- 109,113 ----
          vars[var] = initializer()
      finally:
!         _once_lock.release()
  
  class _RandomNameSequence: