[pypy-svn] pypy default: Implement CPython issue1764407. The test was already written, uncomment it!

amauryfa commits-noreply at bitbucket.org
Fri Feb 11 18:29:35 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41825:9376e51b04d2
Date: 2011-02-11 13:36 +0100
http://bitbucket.org/pypy/pypy/changeset/9376e51b04d2/

Log:	Implement CPython issue1764407. The test was already written,
	uncomment it!

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
@@ -506,7 +506,7 @@
             # handle the "-m" command
             def run_it():
                 import runpy
-                runpy.run_module(sys.argv[0], None, '__main__', True)
+                runpy._run_module_as_main(sys.argv[0])
             success = run_toplevel(run_it)
         elif run_stdin:
             # handle the case where no command/filename/module is specified

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
@@ -391,10 +391,9 @@
         child.expect(re.escape('File: ' + p))
         child.expect(re.escape('Argv: ' + repr([p, 'extra'])))
         child.expect('>>> ')
-        #XXX the following doesn't work on CPython 2.5 either
-        #child.sendline('somevalue')
-        #child.expect(re.escape(repr("foobar")))
-        #child.expect('>>> ')
+        child.sendline('somevalue')
+        child.expect(re.escape(repr("foobar")))
+        child.expect('>>> ')
         child.sendline('import sys')
         child.sendline('"pypy.translator.goal.test2" in sys.modules')
         child.expect('True')


More information about the Pypy-commit mailing list