From 354e43ca1e1a671a9a2a64e40d8fedc19b848ce6 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 9 Jan 2012 13:21:49 +0100 Subject: s4:python tests __init__.py - do not depend on "subprocess.check_call()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source4/scripting/python/samba/tests/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py index d9fbb15a02..e2baa749b7 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) -- cgit