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
|
#errors might occur, for example, if files are locked
|
||||||
#we just ignore them if raiseExceptions is not set
|
#we just ignore them if raiseExceptions is not set
|
||||||
try:
|
try:
|
||||||
|
h.acquire()
|
||||||
h.flush()
|
h.flush()
|
||||||
h.close()
|
h.close()
|
||||||
except:
|
except:
|
||||||
if raiseExceptions:
|
if raiseExceptions:
|
||||||
raise
|
raise
|
||||||
#else, swallow
|
#else, swallow
|
||||||
|
finally:
|
||||||
|
h.release()
|
||||||
|
|
||||||
#Let's try and shutdown automatically on application exit...
|
#Let's try and shutdown automatically on application exit...
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue