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

This commit is contained in:
Vinay Sajip 2011-03-08 22:49:57 +00:00
parent 49d7149e6d
commit c8ab6eeb01

View file

@ -1507,12 +1507,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: