--- a/mercurial/statichttprepo.py Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/statichttprepo.py Tue May 31 22:50:01 2022 +0200
@@ -181,9 +181,7 @@
try:
requirements = set(self.vfs.read(b'requires').splitlines())
- except IOError as inst:
- if inst.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
requirements = set()
# check if it is a non-empty old-style repository
@@ -191,9 +189,7 @@
fp = self.vfs(b"00changelog.i")
fp.read(1)
fp.close()
- except IOError as inst:
- if inst.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
# we do not care about empty old-style repositories here
msg = _(b"'%s' does not appear to be an hg repository") % path
raise error.RepoError(msg)