dabo Commit
Revision 2242
Date: 2006-06-29 08:33:18 -0700 (Thu, 29 Jun 2006)
Author: ed

Changed:
U   trunk/dabo/dApp.py

Log:
Found an edge case where the temp file handler was throwing an error. This only 
happens when the app, including Python itself, has pretty much shut down, so it 
can be safely ignored.


Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2006-06-29 15:04:02 UTC (rev 2241)
+++ trunk/dabo/dApp.py  2006-06-29 15:33:18 UTC (rev 2242)
@@ -92,12 +92,16 @@
        def _eraseTempFiles(self):
                # Try to erase all temp files created during life.
                # Need to re-import the os module here for some reason.
-               import os
-               for f in self._tempFiles:
-                       try:
-                               os.remove(f)
-                       except StandardError, e:
-                               print "Could not delete %s: %s" % (f, e)
+               try:
+                       import os
+                       for f in self._tempFiles:
+                               try:
+                                       os.remove(f)
+                               except StandardError, e:
+                                       print "Could not delete %s: %s" % (f, e)
+               except:
+                       # In these rare cases, Python has already 'gone away', 
so just bail
+                       pass
        
        
        def release(self):




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to