diff mercurial/templater.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 e53a3d0ef416
children 18489e26d9a0
line wrap: on
line diff
--- a/mercurial/templater.py	Tue Oct 20 08:58:20 2020 -0700
+++ b/mercurial/templater.py	Thu Oct 22 09:58:05 2020 -0700
@@ -312,9 +312,9 @@
 
 
 def _addparseerrorhint(inst, tmpl):
-    if len(inst.args) <= 1:
-        return  # no location
-    loc = inst.args[1]
+    if inst.location is None:
+        return
+    loc = inst.location
     # Offset the caret location by the number of newlines before the
     # location of the error, since we will replace one-char newlines
     # with the two-char literal r'\n'.