Commits

Steve Borho committed 0162d25

visdiff: catch OSError and IOError when deleting temp files

This is slightly better than throwing up a bug report, but only just.

Closes #1135

Comments (0)

Files changed (1)

tortoisehg/hgtk/visdiff.py

             dodiff(tmproot)
         finally:
             ui.note(_('cleaning up temp directory\n'))
-            shutil.rmtree(tmproot)
+            try:
+                shutil.rmtree(tmproot)
+            except (IOError, OSError), e:
+                # Leaking temporary files, fix your diff tool config
+                ui.note(_('unable to clean temp directory: %s\n'), str(e))
 
     tmproot = tempfile.mkdtemp(prefix='visualdiff.')
     if opts.get('mainapp'):