[Python-checkins] r85046 - python/branches/release31-maint/Lib/logging/config.py

vinay.sajip python-checkins at python.org
Mon Sep 27 23:51:36 CEST 2010


Author: vinay.sajip
Date: Mon Sep 27 23:51:36 2010
New Revision: 85046

Log:
Issue #9947: logging: backported locking fix from py3k.

Modified:
   python/branches/release31-maint/Lib/logging/config.py

Modified: python/branches/release31-maint/Lib/logging/config.py
==============================================================================
--- python/branches/release31-maint/Lib/logging/config.py	(original)
+++ python/branches/release31-maint/Lib/logging/config.py	Mon Sep 27 23:51:36 2010
@@ -19,7 +19,7 @@
 is based on PEP 282 and comments thereto in comp.lang.python, and influenced
 by Apache's log4j system.
 
-Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
@@ -370,8 +370,10 @@
     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()


More information about the Python-checkins mailing list