summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:57:18 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-01-15 17:57:18 (GMT)
commitb51aa7b7eb8a2be1a5f51d7e15c5f7774db7a4b3 (patch)
treecae5b84315b1590b81353ef137d7ebf255c279e3 /Lib/logging
parentfb3c6286a666d1ff16ed58c30a54498f1b152e22 (diff)
parent6e669fba477e1f6c26f8eaf3c7efcf0613e65c7f (diff)
downloadcpython-b51aa7b7eb8a2be1a5f51d7e15c5f7774db7a4b3.zip
cpython-b51aa7b7eb8a2be1a5f51d7e15c5f7774db7a4b3.tar.gz
cpython-b51aa7b7eb8a2be1a5f51d7e15c5f7774db7a4b3.tar.bz2
Issue #9501: Merged fix from 3.3.
Diffstat (limited to 'Lib/logging')
-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 b8e7b37..244c915 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -708,7 +708,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: