diff mercurial/cmdutil.py @ 49305:53e9422a9b45

py3: catch FileExistsError instead of checking errno == EEXIST
author Manuel Jacob <me@manueljacob.de>
date Tue, 31 May 2022 21:16:17 +0200
parents c577d394ed6b
children cdfba684b6a1
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue May 31 16:54:58 2022 +0200
+++ b/mercurial/cmdutil.py	Tue May 31 21:16:17 2022 +0200
@@ -561,9 +561,8 @@
             backupdir = repo.vfs.join(b'record-backups')
             try:
                 os.mkdir(backupdir)
-            except OSError as err:
-                if err.errno != errno.EEXIST:
-                    raise
+            except FileExistsError:
+                pass
         try:
             # backup continues
             for f in tobackup: