Issue #11444: Lock handlers while flushing/closing during shutdown.

This commit is contained in:
Vinay Sajip 2011-03-08 22:39:55 +00:00
parent 8dd2a40bc7
commit f4d0af460a
1 changed files with 3 additions and 0 deletions

View File

@ -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: