From e531e5557a40f2f151b772264832b91ac5977b97 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Thu, 28 Jan 2010 00:06:57 +0000 Subject: Reverted back to r67866. --- Lib/logging/__init__.py | 8 ++++---- Misc/NEWS | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 89bb9f2..07f1add 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -166,10 +166,7 @@ def addLevelName(level, levelName): #the lock would already have been acquired - so we need an RLock. #The same argument applies to Loggers and Manager.loggerDict. # -if thread: - _lock = threading.RLock() -else: - _lock = None +_lock = None def _acquireLock(): """ @@ -177,6 +174,9 @@ def _acquireLock(): This should be released with _releaseLock(). """ + global _lock + if (not _lock) and thread: + _lock = threading.RLock() if _lock: _lock.acquire() diff --git a/Misc/NEWS b/Misc/NEWS index f7264af..294c530 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -9,11 +9,6 @@ hat's New in Python 2.4.7? *Release date: XX-XXX-2009* -Library -------- - -- Issue #7403: logging: Fixed possible race condition in lock creation. - What's New in Python 2.4.6? =========================== -- cgit v0.12