mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Issue #11444: Lock handlers while flushing/closing during shutdown.
This commit is contained in:
parent
49d7149e6d
commit
c8ab6eeb01
1 changed files with 3 additions and 0 deletions
|
|
@ -1507,12 +1507,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…
Add table
Add a link
Reference in a new issue