Ignore exceptions which occur when closing files in shutdown()

This commit is contained in:
Vinay Sajip 2004-07-29 09:19:30 +00:00
parent f9fd0d7988
commit e12f71586a
1 changed files with 7 additions and 2 deletions

View File

@ -1256,8 +1256,13 @@ def shutdown():
Should be called at application exit.
"""
for h in _handlers.keys():
h.flush()
h.close()
#errors might occur, for example, if files are locked
#we just ignore them
try:
h.flush()
h.close()
except:
pass
#Let's try and shutdown automatically on application exit...
try: