[pypy-svn] rev 647 - pypy/trunk/src/pypy/interpreter

alex at codespeak.net alex at codespeak.net
Thu May 29 12:08:14 CEST 2003


Author: alex
Date: Thu May 29 12:08:14 2003
New Revision: 647

Modified:
   pypy/trunk/src/pypy/interpreter/main.py
Log:
runs with a specified object-space if environment variable OBJSPACE
specifies one (through the logic of testsupport), otherwise (as before)
defaults to the standard object space.



Modified: pypy/trunk/src/pypy/interpreter/main.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/main.py	(original)
+++ pypy/trunk/src/pypy/interpreter/main.py	Thu May 29 12:08:14 2003
@@ -1,7 +1,8 @@
+import testsupport
 from pypy.objspace.std import StdObjSpace
 from pypy.module.builtin import Builtin
 from pypy.interpreter import executioncontext, baseobjspace, pyframe
-import sys
+import sys, os
 
 def run_string(source, fname, space=None):
     try:
@@ -34,9 +35,14 @@
 def main(argv=None):
     if argv is None:
         argv = sys.argv
+    if os.environ.get('OBJSPACE'):
+        space = testsupport.objspace()
+        print "Running with %r" % os.environ.get('OBJSPACE')
+    else:
+        space = None
 
     try:
-        run_file(argv[1])
+        run_file(argv[1], space)
     except baseobjspace.PyPyError, pypyerr:
         pypyerr.operationerr.print_detailed_traceback(pypyerr.space)
 


More information about the Pypy-commit mailing list