Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepoutil.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 | f254fc73d956 |
children | b539c60a79ac |
line wrap: on
line diff
--- a/mercurial/subrepoutil.py Tue May 31 21:16:17 2022 +0200 +++ b/mercurial/subrepoutil.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 os import posixpath import re @@ -63,9 +62,7 @@ if f in ctx: try: data = ctx[f].data() - except IOError as err: - if err.errno != errno.ENOENT: - raise + except FileNotFoundError: # handle missing subrepo spec files as removed ui.warn( _(b"warning: subrepo spec file \'%s\' not found\n") @@ -102,9 +99,8 @@ % (repo.pathto(b'.hgsubstate'), (i + 1)) ) rev[path] = revision - except IOError as err: - if err.errno != errno.ENOENT: - raise + except FileNotFoundError: + pass def remap(src): # type: (bytes) -> bytes