summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:55:57 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:55:57 (GMT)
commit5e1c3ce13366ec72b5e9b67d5681266ad93c0ee1 (patch)
tree6fab045ffb84151e2513e2aaef87c56a645e7646 /Lib
parentb1396523660ac74435976fcaa2d490f3124c6add (diff)
downloadcpython-5e1c3ce13366ec72b5e9b67d5681266ad93c0ee1.zip
cpython-5e1c3ce13366ec72b5e9b67d5681266ad93c0ee1.tar.gz
cpython-5e1c3ce13366ec72b5e9b67d5681266ad93c0ee1.tar.bz2
Issue #9501: Improved shutdown handling to deal with module attributes correctly.
Diffstat (limited to 'Lib')
-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 4da07f1..5cb2866 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -711,7 +711,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: