changeset 34331:e473f482b9b3

templater: use helper function to get name of non-iterable keyword
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Sep 2017 19:01:18 +0900
parents 6c7aaf59b21e
children 86d050abd5c1
files mercurial/templater.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Tue Sep 26 15:55:01 2017 +0200
+++ b/mercurial/templater.py	Sat Sep 09 19:01:18 2017 +0900
@@ -423,8 +423,9 @@
         try:
             diter = iter(d)
         except TypeError:
-            if func is runsymbol:
-                raise error.ParseError(_("keyword '%s' is not iterable") % data)
+            sym = findsymbolicname((func, data))
+            if sym:
+                raise error.ParseError(_("keyword '%s' is not iterable") % sym)
             else:
                 raise error.ParseError(_("%r is not iterable") % d)