diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-25 17:48:25 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-25 17:48:25 (GMT) |
commit | 3eac591a5c33f4bd0bdd60a76053cd3b6b6e5918 (patch) | |
tree | fcfd22330c803fc3e0449324483391a83a49232f /Lib/logging | |
parent | 546885ea4e3d1360bfc43d3890497aa91180d98d (diff) | |
download | cpython-3eac591a5c33f4bd0bdd60a76053cd3b6b6e5918.zip cpython-3eac591a5c33f4bd0bdd60a76053cd3b6b6e5918.tar.gz cpython-3eac591a5c33f4bd0bdd60a76053cd3b6b6e5918.tar.bz2 |
Issue #9947: logging: Fixed locking bug in stopListening.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/config.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 356183f..258cc9c 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -895,8 +895,10 @@ def stopListening(): Stop the listening server which was created with a call to listen(). """ global _listener - if _listener: - logging._acquireLock() - _listener.abort = 1 - _listener = None + logging._acquireLock() + try: + if _listener: + _listener.abort = 1 + _listener = None + finally: logging._releaseLock() |