summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-08-13 23:31:02 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-08-13 23:31:02 (GMT)
commit1749b252c9b30510e755cf775d3262510d5a585d (patch)
tree9c6a4f6333f7930f839a276ea071db09ca316188
parentfd0f0c9f02feeae88e648d2df483717f307ab413 (diff)
downloadcpython-1749b252c9b30510e755cf775d3262510d5a585d.zip
cpython-1749b252c9b30510e755cf775d3262510d5a585d.tar.gz
cpython-1749b252c9b30510e755cf775d3262510d5a585d.tar.bz2
_once(): Removed obfuscating aliasing of _once_lock.
-rw-r--r--Lib/tempfile.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index dff2ae9..d3ec9a4 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -98,19 +98,17 @@ def _once(var, initializer):
"""
vars = globals()
- lock = _once_lock
-
# Check first outside the lock.
if vars.get(var) is not None:
return
try:
- lock.acquire()
+ _once_lock.acquire()
# Check again inside the lock.
if vars.get(var) is not None:
return
vars[var] = initializer()
finally:
- lock.release()
+ _once_lock.release()
class _RandomNameSequence:
"""An instance of _RandomNameSequence generates an endless