- [bug] Fixed Py3K bug in the Babel extension.
diff --git a/CHANGES b/CHANGES
index f49c6f2..afb82d4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
+
0.7.3
- [bug] AST supporting now supports tuple-packed
function arguments inside pure-python def
or lambda expressions. [ticket:201]
+- [bug] Fixed Py3K bug in the Babel extension.
+
0.7.2
- [bug] Fixed regression in 0.7.1 where AST
parsing for Py2.4 was broken.
diff --git a/mako/ext/babelplugin.py b/mako/ext/babelplugin.py
index 65f7e02..085938d 100644
--- a/mako/ext/babelplugin.py
+++ b/mako/ext/babelplugin.py
@@ -9,7 +9,7 @@
from babel.messages.extract import extract_python
-from mako import lexer, parsetree
+from mako import lexer, parsetree, util
def extract(fileobj, keywords, comment_tags, options):
"""Extract messages from Mako templates.
@@ -108,7 +108,7 @@
translator_comments = \
[comment[1] for comment in translator_comments]
- if isinstance(code, unicode):
+ if not util.py3k and isinstance(code, unicode):
code = code.encode('ascii', 'backslashreplace')
code = StringIO(code)
for lineno, funcname, messages, python_translator_comments \