[pypy-commit] pypy app_main-refactor: test and fix for missing os

antocuni noreply at buildbot.pypy.org
Sat Jun 9 14:01:59 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: app_main-refactor
Changeset: r55536:2408badf1c6e
Date: 2012-06-09 13:32 +0200
http://bitbucket.org/pypy/pypy/changeset/2408badf1c6e/

Log:	test and fix for missing os

diff --git a/pypy/translator/goal/app_main.py b/pypy/translator/goal/app_main.py
--- a/pypy/translator/goal/app_main.py
+++ b/pypy/translator/goal/app_main.py
@@ -674,6 +674,8 @@
     sys.executable = executable
 
 def entry_point(executable, argv, nanos):
+    global os
+    os = nanos
     setup_bootstrap_path(executable)
     try:
         cmdline = parse_command_line(argv)
diff --git a/pypy/translator/goal/test2/test_app_main.py b/pypy/translator/goal/test2/test_app_main.py
--- a/pypy/translator/goal/test2/test_app_main.py
+++ b/pypy/translator/goal/test2/test_app_main.py
@@ -880,3 +880,16 @@
                 assert p.startswith(self.trunkdir)
         finally:
             sys.path[:] = old_sys_path
+
+    def test_entry_point(self):
+        import sys
+        import os
+        old_sys_path = sys.path[:]
+        sys.path.append(self.goal_dir)
+        try:
+            import app_main
+            pypy_c = os.path.join(self.trunkdir, 'pypy', 'translator', 'goal', 'pypy-c')
+            app_main.entry_point(pypy_c, ['-c', 'pass'], os)
+            # assert it did not crash
+        finally:
+            sys.path[:] = old_sys_path


More information about the pypy-commit mailing list