]> granicus.if.org Git - python/commitdiff
Ignore exceptions which occur when closing files in shutdown()
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 29 Jul 2004 09:19:30 +0000 (09:19 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 29 Jul 2004 09:19:30 +0000 (09:19 +0000)
Lib/logging/__init__.py

index e9bcf33ec47813c09ed51c3fd96f43dc1b5f781d..8c63160c16714ba8620fda89a627722f39c305c9 100644 (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: