]> granicus.if.org Git - python/commitdiff
Issue #9947: logging: Fixed locking bug in stopListening.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 25 Sep 2010 17:48:25 +0000 (17:48 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Sat, 25 Sep 2010 17:48:25 +0000 (17:48 +0000)
Lib/logging/config.py
Misc/NEWS

index 356183f5ed0c968a4060083d45eca13b31353a49..258cc9c31c9d9e49c166e0351e2f66782af24992 100644 (file)
@@ -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()
index e6acb856d9aa8022c2c0094b85a8fecd0d72b3ca..90a17617fa7c711053346f5b60a71a30a8dc7f5c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -43,6 +43,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #9947: logging: Fixed locking bug in stopListening.
+
 - Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
 
 - Issue #9936: Fixed executable lines' search in the trace module.