Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.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 | 642e31cb55f0 |
children | 050dc8730858 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Tue May 31 21:16:17 2022 +0200 +++ b/mercurial/dirstate.py Tue May 31 22:50:01 2022 +0200 @@ -195,9 +195,7 @@ def _branch(self): try: return self._opener.read(b"branch").strip() or b"default" - except IOError as inst: - if inst.errno != errno.ENOENT: - raise + except FileNotFoundError: return b"default" @property