diff mercurial/bookmarks.py @ 49306:2e726c934fcd

py3: catch FileNotFoundError instead of checking errno == ENOENT
author Manuel Jacob <me@manueljacob.de>
date Tue, 31 May 2022 22:50:01 +0200
parents 63fd0282ad40
children 18c8c18993f0
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/bookmarks.py	Tue May 31 22:50:01 2022 +0200
@@ -6,7 +6,6 @@
 # GNU General Public License version 2 or any later version.
 
 
-import errno
 import struct
 
 from .i18n import _
@@ -114,9 +113,8 @@
                             _(b'malformed line in %s: %r\n')
                             % (bookmarkspath, pycompat.bytestr(line))
                         )
-        except IOError as inst:
-            if inst.errno != errno.ENOENT:
-                raise
+        except FileNotFoundError:
+            pass
         self._active = _readactive(repo, self)
 
     @property