Skip to content

Commit

Permalink
Workaround for changed API of chameleon.codegen.Suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulif committed Feb 26, 2010
1 parent 77e4a05 commit 2bbe70e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/z3c/pt/pagetemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ def evaluate_expression(pragma, expr):
try:
code = _expr_cache[code_cache_key]
except KeyError:
suite = codegen.Suite(source, _locals)
suite = None
try:
# Backwards compatibility (Chameleon < 1.1)
suite = codegen.Suite(source, _locals)
except TypeError:
# Chameleon >= 1.1 does not support a second parameter on
# Suite()
suite = codegen.Suite(source)
code = compiler.compile(
suite.source, 'dynamic_path_expression.py', 'exec')
_expr_cache[code_cache_key] = code
Expand Down

0 comments on commit 2bbe70e

Please sign in to comment.