diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-25 17:48:25 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-25 17:48:25 (GMT) |
commit | 9fdd11b3b6e76d76eb6c22e3d60f4c17ae91a725 (patch) | |
tree | 056e526bc326416eed71c01ec5d5e2d2a5a0fc39 /Lib | |
parent | 32fb6a81f992d86bb4c227912602c224dbbc7d7f (diff) | |
download | cpython-9fdd11b3b6e76d76eb6c22e3d60f4c17ae91a725.zip cpython-9fdd11b3b6e76d76eb6c22e3d60f4c17ae91a725.tar.gz cpython-9fdd11b3b6e76d76eb6c22e3d60f4c17ae91a725.tar.bz2 |
Issue #9947: logging: Fixed locking bug in stopListening.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/logging/config.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index cc75e94..60744a0 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -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() |