[pypy-svn] r63701 - pypy/trunk/pypy/interpreter/astcompiler

fijal at codespeak.net fijal at codespeak.net
Mon Apr 6 05:20:19 CEST 2009


Author: fijal
Date: Mon Apr  6 05:20:16 2009
New Revision: 63701

Modified:
   pypy/trunk/pypy/interpreter/astcompiler/pycodegen.py
   pypy/trunk/pypy/interpreter/astcompiler/symbols.py
Log:
(benjamin) fix test_exec


Modified: pypy/trunk/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/trunk/pypy/interpreter/astcompiler/pycodegen.py	(original)
+++ pypy/trunk/pypy/interpreter/astcompiler/pycodegen.py	Mon Apr  6 05:20:16 2009
@@ -1351,7 +1351,8 @@
     def __init__(self, space, scope, func, isLambda, mod, initialnode=None):
         assert scope is not None
         self.scope = scope
-        self.localsfullyknown = self.scope.locals_fully_known()
+        self.localsfullyknown = self.scope.locals_fully_known() and \
+            not self.scope.has_exec
         self.module = mod
         if isLambda:
             name = "<lambda>"

Modified: pypy/trunk/pypy/interpreter/astcompiler/symbols.py
==============================================================================
--- pypy/trunk/pypy/interpreter/astcompiler/symbols.py	(original)
+++ pypy/trunk/pypy/interpreter/astcompiler/symbols.py	Mon Apr  6 05:20:16 2009
@@ -22,6 +22,7 @@
 class Scope:
     bare_exec = False
     import_star = False
+    has_exec = False
 
     def __init__(self, name, parent):
         self.name = name
@@ -373,8 +374,9 @@
         self.pop_scope()
 
     def visitExec(self, node):
+        parent = self.cur_scope()
+        parent.has_exec = True
         if not (node.globals or node.locals):
-            parent = self.cur_scope()
             parent.bare_exec = True
         ast.ASTVisitor.visitExec(self, node)
 



More information about the Pypy-commit mailing list