# HG changeset patch # User cmlenz # Date 1184325038 0 # Node ID 9d1c5c290254208ef639a4e29af2047b3677dfeb # Parent b3dc05d8875149eff560959d96abe5b86650d5b1 Built-in Python constants (such as `None`) in expressions are used directly instead of being looked up from the context. diff --git a/genshi/template/eval.py b/genshi/template/eval.py --- a/genshi/template/eval.py +++ b/genshi/template/eval.py @@ -390,7 +390,7 @@ BUILTINS = __builtin__.__dict__.copy() BUILTINS.update({'Markup': Markup, 'Undefined': Undefined}) - +CONSTANTS = frozenset(['False', 'True', 'None', 'NotImplemented', 'Ellipsis']) class ASTTransformer(object): """General purpose base class for AST transformations. @@ -654,7 +654,7 @@ """ def __init__(self): - self.locals = [] + self.locals = [CONSTANTS, set()] def visitConst(self, node): if isinstance(node.value, str):