diff -r 53e9422a9b45 -r 2e726c934fcd mercurial/store.py --- a/mercurial/store.py Tue May 31 21:16:17 2022 +0200 +++ b/mercurial/store.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 functools import os import re @@ -788,9 +787,8 @@ assert t is not None, f t |= FILEFLAGS_FILELOG yield t, f, self.getsize(ef) - except OSError as err: - if err.errno != errno.ENOENT: - raise + except FileNotFoundError: + pass def copylist(self): d = ( @@ -825,10 +823,7 @@ try: self.getsize(ef) return True - except OSError as err: - if err.errno != errno.ENOENT: - raise - # nonexistent entry + except FileNotFoundError: return False def __contains__(self, path):