# HG changeset patch # User Thomas Arendsen Hein # Date 1160592782 -7200 # Node ID bc5985d533860302c7d96ebc646c0bc8725fd802 # Parent ef8307585b418431c9d77d1b17a61290c305ce71 templater: Better exception for errors in foo%bar formatting. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -135,7 +135,11 @@ class templater(object): fl = m.group(4) if format: - q = v.__iter__ + try: + q = v.__iter__ + except AttributeError: + raise SyntaxError(_("Error expanding '%s%s'") + % (key, format)) for i in q(): lm.update(i) yield self(format[1:], **lm)