From 13269923585888912e2433c15c0ca010a9897595 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 26 Oct 2012 17:31:40 -0800 Subject: [PATCH] selftesthelpers: Fix detection of tap2subunit. Autobuild-User(master): Jelmer Vernooij Autobuild-Date(master): Sat Oct 27 16:57:49 CEST 2012 on sn-devel-104 --- selftest/selftesthelpers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py index 00fa8aae7c8..8d36356293e 100644 --- a/selftest/selftesthelpers.py +++ b/selftest/selftesthelpers.py @@ -18,6 +18,7 @@ # three separated by newlines. All other lines in the output are considered # comments. +import errno import os import subprocess import sys @@ -68,7 +69,7 @@ python = os.getenv("PYTHON", "python") tap2subunit = "PYTHONPATH=%s/lib/subunit/python:%s/lib/testtools %s %s/lib/subunit/filters/tap2subunit" % (srcdir(), srcdir(), python, srcdir()) sub = subprocess.Popen("tap2subunit", stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) sub.communicate("") if sub.returncode == 0: @@ -210,7 +211,12 @@ def print_smbtorture4_version(): :return: Whether smbtorture4 was successfully run """ - sub = subprocess.Popen([smbtorture4, "-V"], stdout=sys.stderr) + try: + sub = subprocess.Popen([smbtorture4, "-V"], stdout=sys.stderr) + except OSError, e: + if e.errno == errno.ENOENT: + return False + raise sub.communicate("") return (sub.returncode == 0) -- 2.34.1