[Zope-CVS] CVS: Packages/pypes/pypes - expression.py:1.17

Casey Duncan casey at zope.com
Tue May 11 23:59:11 EDT 2004


Update of /cvs-repository/Packages/pypes/pypes
In directory cvs.zope.org:/tmp/cvs-serv19484

Modified Files:
	expression.py 
Log Message:
allow makeFunction access to expression bindings


=== Packages/pypes/pypes/expression.py 1.16 => 1.17 ===
--- Packages/pypes/pypes/expression.py:1.16	Tue May 11 23:48:47 2004
+++ Packages/pypes/pypes/expression.py	Tue May 11 23:58:40 2004
@@ -233,13 +233,12 @@
         tree = self.ast().getChildNodes()[0]
         tree = ast.Stmt([ast.Return(tree)])
         tree = ast.Function(
-            'func', args, defaults=[], flags=0, doc=None, code=tree)
+            '__func__', args, defaults=[], flags=0, doc=None, code=tree)
         tree = ast.Module(None, ast.Stmt([tree]))
         misc.set_filename('<pypes expression>', tree)
-        code = ModuleCodeGenerator(tree).getCode()
-        dict = {}
-        exec code in dict
-        return dict['func']
+        ns = self._bindings.copy()
+        exec ModuleCodeGenerator(tree).getCode() in ns
+        return ns['__func__']
         
     def __eq__(self, other):
         return self is other or (nodesEqual(self._tree, other._tree)




More information about the Zope-CVS mailing list