Mercurial > public > mercurial-scm > hg-stable
diff mercurial/txnutil.py @ 49314: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 | 6000f5b25c9b |
children | f4733654f144 |
line wrap: on
line diff
--- 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)