diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-08-13 23:31:02 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-08-13 23:31:02 (GMT) |
commit | 1749b252c9b30510e755cf775d3262510d5a585d (patch) | |
tree | 9c6a4f6333f7930f839a276ea071db09ca316188 | |
parent | fd0f0c9f02feeae88e648d2df483717f307ab413 (diff) | |
download | cpython-1749b252c9b30510e755cf775d3262510d5a585d.zip cpython-1749b252c9b30510e755cf775d3262510d5a585d.tar.gz cpython-1749b252c9b30510e755cf775d3262510d5a585d.tar.bz2 |
_once(): Removed obfuscating aliasing of _once_lock.
-rw-r--r-- | Lib/tempfile.py | 6 |
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 |