changeset 49309:c463f45fa114

py3: stop catching TypeError that was raised on Python 2
author Manuel Jacob <me@manueljacob.de>
date Tue, 31 May 2022 03:39:42 +0200
parents 227124098e14
children ee4537e365c8
files mercurial/hg.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue May 31 03:06:05 2022 +0200
+++ b/mercurial/hg.py	Tue May 31 03:39:42 2022 +0200
@@ -76,8 +76,7 @@
         # invalid paths specially here.
         st = os.stat(path)
         isfile = stat.S_ISREG(st.st_mode)
-    # Python 2 raises TypeError, Python 3 ValueError.
-    except (TypeError, ValueError) as e:
+    except ValueError as e:
         raise error.Abort(
             _(b'invalid path %s: %s') % (path, stringutil.forcebytestr(e))
         )