filtered out throwaway func name when getting <%include> kwargs
diff --git a/lib/mako/parsetree.py b/lib/mako/parsetree.py index aef1388..ebed303 100644 --- a/lib/mako/parsetree.py +++ b/lib/mako/parsetree.py
@@ -220,11 +220,11 @@ __keyword__ = 'include' def __init__(self, keyword, attributes, **kwargs): super(IncludeTag, self).__init__(keyword, attributes, ('file', 'import', 'args'), (), ('file',), **kwargs) - self.page_args = ast.PythonCode("foo(%s)" % attributes.get('args', ''), self.lineno, self.pos, self.filename) + self.page_args = ast.PythonCode("__DUMMY(%s)" % attributes.get('args', ''), self.lineno, self.pos, self.filename) def declared_identifiers(self): return [] def undeclared_identifiers(self): - identifiers = self.page_args.undeclared_identifiers + identifiers = self.page_args.undeclared_identifiers.difference(util.Set(["__DUMMY"])) return identifiers.union(super(IncludeTag, self).undeclared_identifiers()) class NamespaceTag(Tag):
diff --git a/test/template.py b/test/template.py index 82952d5..3627dad 100644 --- a/test/template.py +++ b/test/template.py
@@ -200,6 +200,7 @@ <%page args="a,b,c"/> this is b. ${a}, ${b}, ${c} """) + print lookup.get_template("a").code assert flatten_result(lookup.get_template("a").render(a=7,b=8)) == "this is a this is b. 7, 8, 5" def test_include_withargs(self):