diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-27 21:51:36 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-27 21:51:36 (GMT) |
commit | 805ddaa3daeba06294973df7603e0d2f2014c4ff (patch) | |
tree | e76f161048cea19763e136b53a1b2a9c552da301 /Lib/logging/config.py | |
parent | 3ab905f17bebb69bba4df2a4baa0af3e973eb2b2 (diff) | |
download | cpython-805ddaa3daeba06294973df7603e0d2f2014c4ff.zip cpython-805ddaa3daeba06294973df7603e0d2f2014c4ff.tar.gz cpython-805ddaa3daeba06294973df7603e0d2f2014c4ff.tar.bz2 |
Issue #9947: logging: backported locking fix from py3k.
Diffstat (limited to 'Lib/logging/config.py')
-rw-r--r-- | Lib/logging/config.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 07574d3..2ca7845 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -19,7 +19,7 @@ Configuration functions for the logging package for Python. The core package 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 @@ 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() |