summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-25 17:48:25 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-09-25 17:48:25 (GMT)
commit3eac591a5c33f4bd0bdd60a76053cd3b6b6e5918 (patch)
treefcfd22330c803fc3e0449324483391a83a49232f /Lib/logging
parent546885ea4e3d1360bfc43d3890497aa91180d98d (diff)
downloadcpython-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.py10
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()