diff options
-rw-r--r-- | tests/system/shared/utils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 1429cb6c0f4..bdd64fcdcd8 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -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): |