cpython: 28a0ae3dcb16 (original) (raw)

Mercurial > cpython

changeset 86882:28a0ae3dcb16

Issue #10197: merge heads [#10197]

Tim Golden mail@timgolden.me.uk
date Sun, 03 Nov 2013 14:21:29 +0000
parents 2ed8d500e113(current diff)05ce1bd1a4c2(diff)
children fe828884a077
files Misc/NEWS
diffstat 3 files changed, 14 insertions(+), 24 deletions(-)[+] [-] Lib/subprocess.py 24 Lib/test/test_subprocess.py 11 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -700,21 +700,15 @@ def getstatusoutput(cmd): >>> subprocess.getstatusoutput('/bin/junk') (256, 'sh: /bin/junk: not found') """

-

def getoutput(cmd): """Return output (stdout or stderr) of executing cmd in a shell.

--- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2158,13 +2158,6 @@ class Win32ProcessTestCase(BaseTestCase) def test_terminate_dead(self): self._kill_dead_process('terminate') - -# The module says: -# "NB This only works (and is only relevant) for UNIX." -# -# Actually, getoutput should work on any platform with an os.popen, but -# I'll take the comment as given, and skip this suite. -@unittest.skipUnless(os.name == 'posix', "only relevant for UNIX") class CommandTests(unittest.TestCase): def test_getoutput(self): self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy') @@ -2178,8 +2171,8 @@ class CommandTests(unittest.TestCase): try: dir = tempfile.mkdtemp() name = os.path.join(dir, "foo") -

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -35,6 +35,9 @@ Library TypeError instead of TclError on wrong number of arguments. Original patch by Guilherme Polo. +- Issue #10197: Rework subprocess.get[status]output to use subprocess