]> 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 cc75e94140fe763c48d148be81fc7882f7a59dff..60744a0b4766eb13f158dcce82713149fb8aa095 100644 (file)
@@ -917,8 +917,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 c84a8ef3c465106f5c1a5f2341bbb7c7f3539627..b3af982e782bf45fd9fe3b40f8e93962d5d89cd3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -68,6 +68,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.