mercurial/windows.py
changeset 49305 53e9422a9b45
parent 48986 d500df2e8034
child 49311 defc369d705e
--- a/mercurial/windows.py	Tue May 31 16:54:58 2022 +0200
+++ b/mercurial/windows.py	Tue May 31 21:16:17 2022 +0200
@@ -638,9 +638,7 @@
     '''atomically rename file src to dst, replacing dst if it exists'''
     try:
         os.rename(src, dst)
-    except OSError as e:
-        if e.errno != errno.EEXIST:
-            raise
+    except FileExistsError:
         unlink(dst)
         os.rename(src, dst)