mercurial/revsetlang.py
changeset 45776 0fc8b066928a
parent 43106 d783f945a701
child 45886 18489e26d9a0
--- 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