mirror of https://github.com/python/cpython
Issue #11444: Lock handlers while flushing/closing during shutdown.
This commit is contained in:
parent
8dd2a40bc7
commit
f4d0af460a
|
@ -1513,12 +1513,15 @@ def shutdown(handlerList=_handlerList):
|
|||
#errors might occur, for example, if files are locked
|
||||
#we just ignore them if raiseExceptions is not set
|
||||
try:
|
||||
h.acquire()
|
||||
h.flush()
|
||||
h.close()
|
||||
except:
|
||||
if raiseExceptions:
|
||||
raise
|
||||
#else, swallow
|
||||
finally:
|
||||
h.release()
|
||||
|
||||
#Let's try and shutdown automatically on application exit...
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue