diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-01-15 17:57:18 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-01-15 17:57:18 +0000 |
commit | f586693d6f4fcc95f1e97f1fe228b1f0ec2ffc9d (patch) | |
tree | 3d322e773728a80c25eb3017a7403e4e629a12e2 /Lib/logging | |
parent | 9dfc126a88f58557cfdb2027fabdf6857f05caa7 (diff) | |
parent | aef0437988cc6528a54ab8edda18f2a94eb5427f (diff) | |
download | cpython-f586693d6f4fcc95f1e97f1fe228b1f0ec2ffc9d.tar.gz |
Issue #9501: Merged fix from 3.3.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index b8e7b377b3..244c91536e 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: |