diff -r 53e9422a9b45 -r 2e726c934fcd mercurial/txnutil.py --- a/mercurial/txnutil.py Tue May 31 21:16:17 2022 +0200 +++ b/mercurial/txnutil.py Tue May 31 22:50:01 2022 +0200 @@ -6,8 +6,6 @@ # GNU General Public License version 2 or any later version. -import errno - from . import encoding @@ -29,7 +27,6 @@ if mayhavepending(root): try: return (vfs(b'%s.pending' % filename, **kwargs), True) - except IOError as inst: - if inst.errno != errno.ENOENT: - raise + except FileNotFoundError: + pass return (vfs(filename, **kwargs), False)