# HG changeset patch # User cmlenz # Date 1184325038 0 # Node ID 80fb59bd2342bc2acf0106e5db9fea936d348784 # Parent 21f3c4bdd96496bbae60e59a1cb30e261c128e15 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):