diff genshi/template/eval.py @ 798:c690de5abafd stable-0.5.x

Ported [914], [970], and [971] to 0.5.x branch.
author cmlenz
date Thu, 15 Jan 2009 23:50:09 +0000
parents b40efce75bcd
children cce33406c1cf
line wrap: on
line diff
--- a/genshi/template/eval.py
+++ b/genshi/template/eval.py
@@ -23,6 +23,7 @@
     from sets import ImmutableSet as frozenset
     from sets import Set as set
 from textwrap import dedent
+from types import CodeType
 
 from genshi.core import Markup
 from genshi.template.base import TemplateRuntimeError
@@ -453,7 +454,7 @@
 
     # We'd like to just set co_firstlineno, but it's readonly. So we need to
     # clone the code object while adjusting the line number
-    return new.code(0, code.co_nlocals, code.co_stacksize,
+    return CodeType(0, code.co_nlocals, code.co_stacksize,
                     code.co_flags | 0x0040, code.co_code, code.co_consts,
                     code.co_names, code.co_varnames, filename, name, lineno,
                     code.co_lnotab, (), ())
Copyright (C) 2012-2017 Edgewall Software