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

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


http://hg.python.org/cpython/rev/966887830011
changeset:   81531:966887830011
branch:      2.7
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Tue Jan 15 17:55:13 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
@@ -624,7 +624,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