mercurial/util.py
changeset 9530 ba8a86d86fd6
parent 9524 effa05849027
parent 9529 e61e7b3e46d0
child 9552 f0417b6ff98a
--- a/mercurial/util.py	Sat Oct 03 15:57:48 2009 -0500
+++ b/mercurial/util.py	Wed Oct 07 23:25:41 2009 -0500
@@ -444,7 +444,14 @@
 
         temp = tempname(dst)
         os.rename(dst, temp)
-        os.unlink(temp)
+        try:
+            os.unlink(temp)
+        except:
+            # Some rude AV-scanners on Windows may cause the unlink to
+            # fail. Not aborting here just leaks the temp file, whereas
+            # aborting at this point may leave serious inconsistencies.
+            # Ideally, we would notify the user here.
+            pass
         os.rename(src, dst)
 
 def unlink(f):