Mike Bayer  committed 99d3272 Merge

Merge pull request #5 from vmagamedov/master

Fixed TGPlugin.render method to support unicode template names in py2k.

  • Participants
  • Parent commits 70f561b, 8cccf4a

Comments (0)

Files changed (2)

File mako/ext/

 # This module is part of Mako and is released under
 # the MIT License:
-import re, inspect
+import inspect
+from mako import compat
 from mako.lookup import TemplateLookup
 from mako.template import Template
         return self.lookup.get_template(templatename)
     def render(self, info, format="html", fragment=False, template=None):
-        if isinstance(template, str):
+        if isinstance(template, compat.string_types):
             template = self.load_template(template)
         # Load extra vars func if provided

File test/

     def test_string(self):
         t = tl.load_template('foo', "hello world")
         assert t.render() == "hello world"
+    def test_render(self):
+        assert result_lines(tl.render({}, template='/index.html')) == [
+            "this is index"
+        ]
+        assert result_lines(tl.render({}, template=u'/index.html')) == [
+            "this is index"
+        ]