diff -r 53e9422a9b45 -r 2e726c934fcd hgext/remotefilelog/basestore.py --- a/hgext/remotefilelog/basestore.py Tue May 31 21:16:17 2022 +0200 +++ b/hgext/remotefilelog/basestore.py Tue May 31 22:50:01 2022 +0200 @@ -1,4 +1,3 @@ -import errno import os import shutil import stat @@ -344,10 +343,7 @@ count += 1 try: pathstat = os.stat(path) - except OSError as e: - # errno.ENOENT = no such file or directory - if e.errno != errno.ENOENT: - raise + except FileNotFoundError: msg = _( b"warning: file %s was removed by another process\n" ) @@ -362,10 +358,7 @@ else: try: shallowutil.unlinkfile(path) - except OSError as e: - # errno.ENOENT = no such file or directory - if e.errno != errno.ENOENT: - raise + except FileNotFoundError: msg = _( b"warning: file %s was removed by another " b"process\n" @@ -388,10 +381,7 @@ atime, oldpath, oldpathstat = queue.get() try: shallowutil.unlinkfile(oldpath) - except OSError as e: - # errno.ENOENT = no such file or directory - if e.errno != errno.ENOENT: - raise + except FileNotFoundError: msg = _( b"warning: file %s was removed by another process\n" )