Commits

Michael Hudson-Doyle  committed 9eed7ca

this very basic test works with the stdobjspace, if you comment out the softspace handling
stuff

  • Participants
  • Parent commits f978fc9

Comments (0)

Files changed (3)

File pypy/interpreter/main.py

+from pypy.objspace.std import StdObjSpace
+from pypy.objspace.trivial import TrivialObjSpace
+from pypy.interpreter import executioncontext, baseobjspace
+from pypy.interpreter import pyframe
+
+import sys
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+
+    fname = argv[1]
+
+    space = StdObjSpace()
+    ifile = open(fname)
+    code = compile(ifile.read(), fname, 'exec')
+    ec = executioncontext.ExecutionContext(space)
+
+    w_globals = ec.make_standard_w_globals()
+    frame = pyframe.PyFrame(space, code, w_globals, w_globals)
+    try:
+        ec.eval_frame(frame)
+    except baseobjspace.OperationError, operationerr:
+        # XXX insert exception info into the application-level sys.last_xxx
+        operationerr.print_detailed_traceback(space)
+        
+    
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
+    

File pypy/interpreter/test/hello_world.py

+
+aStr = "hello world"
+print aStr

File pypy/interpreter/test/test_main.py

+import support
+
+from pypy.interpreter import main
+
+main.main(['main.py', 'hello_world.py'])