[Python-checkins] cpython (3.2): Issue #9501: Improved shutdown handling to deal with module attributes

vinay.sajip python-checkins at python.org
Tue Jan 15 18:57:36 CET 2013


http://hg.python.org/cpython/rev/8eac88f49cc0
changeset:   81532:8eac88f49cc0
branch:      3.2
parent:      81527:411bb75be5d1
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Tue Jan 15 17:55:57 2013 +0000
summary:
  Issue #9501: Improved shutdown handling to deal with module attributes correctly.

files:
  Lib/logging/__init__.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -711,7 +711,8 @@
     # This function can be called during module teardown, when globals are
     # set to None. If _acquireLock is None, assume this is the case and do
     # nothing.
-    if _acquireLock is not None:
+    if (_acquireLock is not None and _handlerList is not None and
+        _releaseLock is not None):
         _acquireLock()
         try:
             if wr in _handlerList:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list