Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 805ddaa

Browse files
committed
Issue #9947: logging: backported locking fix from py3k.
1 parent 3ab905f commit 805ddaa

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/logging/config.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
2020
by Apache's log4j system.
2121
22-
Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
22+
Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
2323
2424
To use, simply 'import logging' and log away!
2525
"""
@@ -370,8 +370,10 @@ def stopListening():
370370
Stop the listening server which was created with a call to listen().
371371
"""
372372
global _listener
373-
if _listener:
374-
logging._acquireLock()
375-
_listener.abort = 1
376-
_listener = None
373+
logging._acquireLock()
374+
try:
375+
if _listener:
376+
_listener.abort = 1
377+
_listener = None
378+
finally:
377379
logging._releaseLock()

0 commit comments

Comments
 (0)