Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dirstatemap.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 | 3df46f3a3d6c |
children | b5c8524827d2 |
line wrap: on
line diff
--- a/mercurial/dirstatemap.py Tue May 31 21:16:17 2022 +0200 +++ b/mercurial/dirstatemap.py Tue May 31 22:50:01 2022 +0200 @@ -4,8 +4,6 @@ # GNU General Public License version 2 or any later version. -import errno - from .i18n import _ from . import ( @@ -95,9 +93,7 @@ try: with self._opendirstatefile() as fp: return fp.read(size) - except IOError as err: - if err.errno != errno.ENOENT: - raise + except FileNotFoundError: # File doesn't exist, so the current state is empty return b''