summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:55:13 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:55:13 +0000
commit51b55517a1bef84fc6c508f3eb0ef921148283eb (patch)
tree02c76a52cd98031e25ae2c26782e07402fb910e7
parente39ba04e22c619fe76ff12bd3f6eb5fc0d322416 (diff)
downloadcpython-git-51b55517a1bef84fc6c508f3eb0ef921148283eb.tar.gz
Issue #9501: Improved shutdown handling to deal with module attributes correctly.
-rw-r--r--Lib/logging/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index e53718d745..1a622a3d07 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -624,7 +624,8 @@ def _removeHandlerRef(wr):
# 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: