From 6a82cdb37fc8f39dee64cc5275df7a2c2ce9945e Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 29 Oct 2009 23:46:14 +0100 Subject: [PATCH] fix jython issue, flexibilize sysexec params --HG-- branch : trunk --- _py/path/local.py | 5 +++-- testing/path/test_local.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/_py/path/local.py b/_py/path/local.py index d0c4ce43d..ad8b18323 100644 --- a/_py/path/local.py +++ b/_py/path/local.py @@ -542,14 +542,15 @@ class LocalPath(FSBase): raise return mod - def sysexec(self, *argv): + def sysexec(self, *argv, **popen_opts): """ return stdout text from executing a system child process, where the 'self' path points to executable. The process is directly invoked and not through a system shell. """ from subprocess import Popen, PIPE argv = map(str, argv) - proc = Popen([str(self)] + list(argv), stdout=PIPE, stderr=PIPE) + popen_opts['stdout'] = popen_opts['stderr'] = PIPE + proc = Popen([str(self)] + list(argv), **popen_opts) stdout, stderr = proc.communicate() ret = proc.wait() if py.builtin._isbytes(stdout): diff --git a/testing/path/test_local.py b/testing/path/test_local.py index 82de8a318..228ff87ff 100644 --- a/testing/path/test_local.py +++ b/testing/path/test_local.py @@ -338,7 +338,7 @@ class TestImport: def test_pyimport_check_filepath_consistency(self, monkeypatch, tmpdir): name = 'pointsback123' - ModuleType = type(py.std.sys) + ModuleType = type(py.std.os) p = tmpdir.ensure(name + '.py') for ending in ('.pyc', '$py.class', '.pyo'): mod = ModuleType(name)