Author: Matti Picus <[email protected]>
Branch: py3.5
Changeset: r92867:2e9a42fcdebf
Date: 2017-10-28 23:23 +0300
http://bitbucket.org/pypy/pypy/changeset/2e9a42fcdebf/

Log:    tweak run_with_python()

diff --git a/pypy/tool/pytest/apptest.py b/pypy/tool/pytest/apptest.py
--- a/pypy/tool/pytest/apptest.py
+++ b/pypy/tool/pytest/apptest.py
@@ -12,7 +12,7 @@
 from pypy.interpreter.gateway import app2interp_temp
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.function import Method
-from rpython.tool import runsubprocess
+from rpython.tool.runsubprocess import run_subprocess
 from pypy.tool.pytest import appsupport
 from pypy.tool.pytest.objspace import gettestobjspace
 from rpython.tool.udir import udir
@@ -67,14 +67,10 @@
 def _rename_module(name):
     return str(RENAMED_USEMODULES.get(name, name))
 
-
-def run_with_python(python_, target_, usemodules, **definitions):
-    if python_ is None:
-        py.test.skip("Cannot find the default python3 interpreter to run with 
-A")
-    # we assume that the source of target_ is in utf-8. Unfortunately, we don't
-    # have any easy/standard way to determine from here the original encoding
-    # of the source file
-    helpers = r"""# -*- encoding: utf-8 -*-
+# we assume that the source of target_ is in utf-8. Unfortunately, we don't
+# have any easy/standard way to determine from here the original encoding
+# of the source file
+helpers = r"""# -*- encoding: utf-8 -*-
 if 1:
     import sys
     sys.path.append(%r)
@@ -109,6 +105,10 @@
         pass
     self = Test()
 """
+
+def run_with_python(python_, target_, usemodules, **definitions):
+    if python_ is None:
+        py.test.skip("Cannot find the default python3 interpreter to run with 
-A")
     defs = []
     for symbol, value in sorted(definitions.items()):
         if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
@@ -181,7 +181,7 @@
     helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
     env = os.environ.copy()
     env['PYTHONPATH'] = helper_dir
-    res, stdout, stderr = runsubprocess.run_subprocess(
+    res, stdout, stderr = run_subprocess(
         python_, [str(pyfile)], env=env)
     print pyfile.read()
     print >> sys.stdout, stdout
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to