diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-03 13:56:31 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-03 13:56:31 -0400 |
commit | 542ad006a86f14381ee368ac60c2a5e3547a8f0c (patch) | |
tree | a5d565e2387a16d2fe62b659957c3814ec1b515f | |
parent | 3bd802b9504d9d6f81cb35801cc61267f1f9697c (diff) | |
download | mako-542ad006a86f14381ee368ac60c2a5e3547a8f0c.tar.gz |
- [bug] Fixed Py3K bug where a "lambda" expression was not
interpreted correctly within a template tag. [ticket:190]
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | mako/_ast_util.py | 3 | ||||
-rw-r--r-- | test/__init__.py | 2 | ||||
-rw-r--r-- | test/test_ast.py | 1 |
4 files changed, 8 insertions, 1 deletions
@@ -14,6 +14,9 @@ avoiding TypeError when trying to produce partials. [ticket:207] +- [bug] Fixed Py3K bug where a "lambda" expression was not + interpreted correctly within a template tag. [ticket:190] + 0.8.1 - [bug] Changed setup.py to skip installing markupsafe if Python version is < 2.6 or is between 3.0 and diff --git a/mako/_ast_util.py b/mako/_ast_util.py index 0ae8f8a..cec767c 100644 --- a/mako/_ast_util.py +++ b/mako/_ast_util.py @@ -659,6 +659,9 @@ class SourceGenerator(NodeVisitor): def visit_Name(self, node): self.write(node.id) + def visit_arg(self, node): + self.write(node.arg) + def visit_Str(self, node): self.write(repr(node.s)) diff --git a/test/__init__.py b/test/__init__.py index a3cbaa2..623edcf 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -111,7 +111,7 @@ def requires_pygments_14(fn): version = pygments.__version__ except: version = "0" - return skip_if(lambda: version < "1.4")(fn) + return skip_if(lambda: version < "1.4", "Requires pygments 1.4 or greater")(fn) def requires_no_pygments_exceptions(fn): def go(*arg, **kw): diff --git a/test/test_ast.py b/test/test_ast.py index 84508c7..008bd55 100644 --- a/test/test_ast.py +++ b/test/test_ast.py @@ -316,6 +316,7 @@ import x as bar "repr({'x':-1})", "repr(((1,2,3), (4,5,6)))", "repr(1 and 2 and 3 and 4)", "repr(True and False or 55)", + "repr(lambda x, y: x+y)", "repr(1 & 2 | 3)", "repr(3//5)", "repr(3^5)", |