diff mercurial/revsetlang.py @ 45776:0fc8b066928a

errors: name arguments to ParseError constructor As with similar previous patches, this is to improve readability. Differential Revision: https://phab.mercurial-scm.org/D9240
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 22 Oct 2020 09:58:05 -0700
parents d783f945a701
children 18489e26d9a0
line wrap: on
line diff
--- a/mercurial/revsetlang.py	Tue Oct 20 08:58:20 2020 -0700
+++ b/mercurial/revsetlang.py	Thu Oct 22 09:58:05 2020 -0700
@@ -642,8 +642,8 @@
     try:
         return _parsewith(spec, lookup=lookup)
     except error.ParseError as inst:
-        if len(inst.args) > 1:  # has location
-            loc = inst.args[1]
+        if inst.location is not None:
+            loc = inst.location
             # Remove newlines -- spaces are equivalent whitespace.
             spec = spec.replace(b'\n', b' ')
             # We want the caret to point to the place in the template that