Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/lfcommands.py @ 49306: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 | 63fd0282ad40 |
children | c166b212bdee |
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py Tue May 31 21:16:17 2022 +0200 +++ b/hgext/largefiles/lfcommands.py Tue May 31 22:50:01 2022 +0200 @@ -9,7 +9,6 @@ '''High-level command function for lfconvert, plus the cmdtable.''' import binascii -import errno import os import shutil @@ -474,10 +473,8 @@ for lfile in lfiles: try: expectedhash = lfutil.readasstandin(ctx[lfutil.standin(lfile)]) - except IOError as err: - if err.errno == errno.ENOENT: - continue # node must be None and standin wasn't found in wctx - raise + except FileNotFoundError: + continue # node must be None and standin wasn't found in wctx if not lfutil.findfile(repo, expectedhash): toget.append((lfile, expectedhash))