mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #9947: logging: Fixed locking bug in stopListening.
This commit is contained in:
parent
32fb6a81f9
commit
9fdd11b3b6
2 changed files with 8 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue