[pypy-svn] r5340 - pypy/trunk/src/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Sat Jun 26 11:38:18 CEST 2004


Author: arigo
Date: Sat Jun 26 11:37:56 2004
New Revision: 5340

Modified:
   pypy/trunk/src/pypy/interpreter/gateway.py
   pypy/trunk/src/pypy/interpreter/pyopcode.py
Log:
Previous revision broke test_print in flowobjspace.
Fixed by forcing 'sys' into the app-level helpers' globals
if it is already built (fragile bootstrapping workaround).


Modified: pypy/trunk/src/pypy/interpreter/gateway.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/gateway.py	(original)
+++ pypy/trunk/src/pypy/interpreter/gateway.py	Sat Jun 26 11:37:56 2004
@@ -198,8 +198,6 @@
             else:
                 # no, we build all Gateways in the staticglobals now.
                 w_globals = build_dict(self.staticglobals, space)
-                if '__setupgateways__' in self.staticglobals:
-                    self.staticglobals['__setupgateways__'](space)
         return self.build_function(space, w_globals)
 
     def build_function(self, space, w_globals):
@@ -326,4 +324,6 @@
             w_name = space.wrap(value.name)
             w_object = space.wrap(fn)
             space.setitem(w_globals, w_name, w_object)
+    if hasattr(space, 'w_sys'):  # give them 'sys' if it exists already
+        space.setitem(w_globals, space.wrap('sys'), space.w_sys)
     return w_globals

Modified: pypy/trunk/src/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/pyopcode.py	(original)
+++ pypy/trunk/src/pypy/interpreter/pyopcode.py	Sat Jun 26 11:37:56 2004
@@ -794,10 +794,6 @@
 # There are also a couple of helpers that are methods, defined in the
 # class above.
 
-def app___setupgateways__():
-    global sys
-    import sys
-
 def app_print_expr(x):
     try:
         displayhook = sys.displayhook



More information about the Pypy-commit mailing list