From: Matthias Dieter Wallnöfer Date: Mon, 9 Jan 2012 12:21:49 +0000 (+0100) Subject: s4:python tests __init__.py - do not depend on "subprocess.check_call()" X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=354e43ca1e1a671a9a2a64e40d8fedc19b848ce6;p=obnox%2Fsamba%2Fsamba-obnox.git s4:python tests __init__.py - do not depend on "subprocess.check_call()" Method not present in Python 2.4 Reviewed-by: Jelmer Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Tue Jan 10 00:41:59 CET 2012 on sn-devel-104 --- diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py index d9fbb15a028..e2baa749b7f 100644 --- a/source4/scripting/python/samba/tests/__init__.py +++ b/source4/scripting/python/samba/tests/__init__.py @@ -154,7 +154,10 @@ class BlackboxTestCase(TestCase): def check_run(self, line): line = self._make_cmdline(line) - subprocess.check_call(line, shell=True) + p = subprocess.Popen(line, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + retcode = p.wait() + if retcode: + raise BlackboxProcessError(retcode, line, p.stdout.read(), p.stderr.read()) def check_output(self, line): line = self._make_cmdline(line)