[pypy-svn] r11747 - pypy/dist/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Mon May 2 00:43:34 CEST 2005


Author: arigo
Date: Mon May  2 00:43:34 2005
New Revision: 11747

Modified:
   pypy/dist/pypy/interpreter/pyopcode.py
Log:
Very obscure.  This change is needed to prevent one failure in the flow graph
tests in the presence of geninterplevel.py.



Modified: pypy/dist/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyopcode.py	(original)
+++ pypy/dist/pypy/interpreter/pyopcode.py	Mon May  2 00:43:34 2005
@@ -787,7 +787,15 @@
         except AttributeError:
             pass
         return softspace
+''', filename=__file__)
 
+sys_stdout      = app.interphook('sys_stdout')
+print_expr      = app.interphook('print_expr')
+print_item_to   = app.interphook('print_item_to')
+print_newline_to= app.interphook('print_newline_to')
+file_softspace  = app.interphook('file_softspace')
+
+app = gateway.applevel(r'''
     def find_metaclass(bases, namespace, globals, builtin):
         if '__metaclass__' in namespace:
             return namespace['__metaclass__']
@@ -804,7 +812,11 @@
                 return builtin.__metaclass__ 
             except AttributeError: 
                 return type
+''', filename=__file__)
 
+find_metaclass  = app.interphook('find_metaclass')
+
+app = gateway.applevel(r'''
     def import_all_from(module, into_locals):
         try:
             all = module.__all__
@@ -822,7 +834,11 @@
             if skip_leading_underscores and name[0]=='_':
                 continue
             into_locals[name] = getattr(module, name)
+''', filename=__file__)
 
+import_all_from = app.interphook('import_all_from')
+
+app = gateway.applevel(r'''
     def prepare_exec(f, prog, globals, locals, compile_flags, builtin, codetype):
         """Manipulate parameters to exec statement to (codeobject, dict, dict).
         """
@@ -864,14 +880,6 @@
                                     "or code object")
             prog = compile(prog, filename, 'exec', compile_flags, 1)
         return (prog, globals, locals)
-
 ''', filename=__file__)
 
-sys_stdout      = app.interphook('sys_stdout')
-print_expr      = app.interphook('print_expr')
-print_item_to   = app.interphook('print_item_to')
-print_newline_to= app.interphook('print_newline_to')
-file_softspace  = app.interphook('file_softspace')
-find_metaclass  = app.interphook('find_metaclass')
-import_all_from = app.interphook('import_all_from')
 prepare_exec    = app.interphook('prepare_exec')



More information about the Pypy-commit mailing list