changeset 3361:bc5985d53386

templater: Better exception for errors in foo%bar formatting.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 11 Oct 2006 20:53:02 +0200
parents ef8307585b41
children 887da2247b57
files mercurial/templater.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Thu Oct 12 11:40:26 2006 +0200
+++ b/mercurial/templater.py	Wed Oct 11 20:53:02 2006 +0200
@@ -135,7 +135,11 @@
                 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)