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

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Tue, 13 Aug 2002 16:29:23 -0700


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

Modified Files:
	tempfile.py 
Log Message:
_once():  Simplified dict manipulation.


Index: tempfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/tempfile.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** tempfile.py	9 Aug 2002 18:00:27 -0000	1.41
--- tempfile.py	13 Aug 2002 23:29:21 -0000	1.42
***************
*** 102,111 ****
  
      # Check first outside the lock.
!     if var in vars and vars[var] is not None:
          return
      try:
          lock.acquire()
          # Check again inside the lock.
!         if var in vars and vars[var] is not None:
              return
          vars[var] = initializer()
--- 102,111 ----
  
      # 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:
              return
          vars[var] = initializer()