Squish: Silence warnings in tst_default_settings

Change-Id: I668cc7b1fcb569b50d2178fe792f566721c9d4d4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2016-05-30 11:52:37 +02:00
parent c1e7cf84e4
commit 7e9aa9c908
+4 -3
View File
@@ -139,7 +139,7 @@ def which(program):
command = "where"
else:
command = "which"
foundPath = getOutputFromCmdline([command, program])
foundPath = getOutputFromCmdline([command, program], acceptedError=1)
if foundPath:
return foundPath.splitlines()[0]
else:
@@ -216,11 +216,12 @@ def logApplicationOutput():
return None
# get the output from a given cmdline call
def getOutputFromCmdline(cmdline, environment=None):
def getOutputFromCmdline(cmdline, environment=None, acceptedError=0):
try:
return subprocess.check_output(cmdline, env=environment)
except subprocess.CalledProcessError as e:
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
if e.returncode != acceptedError:
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
return e.output
def selectFromFileDialog(fileName, waitForFile=False):