Commit e564abdd authored by Christian Stenger's avatar Christian Stenger

Squish: Use more stable subprocess code

Change-Id: I9a895831f9d57562a9eeb8491cc7f46c1da2eba1
Reviewed-by: default avatarRobert Loehning <robert.loehning@qt.io>
parent a00a73a7
......@@ -217,10 +217,11 @@ def logApplicationOutput():
# get the output from a given cmdline call
def getOutputFromCmdline(cmdline):
versCall = subprocess.Popen(cmdline, stdout=subprocess.PIPE, shell=True)
result = versCall.communicate()[0]
versCall.stdout.close()
return result
try:
return subprocess.check_output(cmdline, shell=True) # TODO: do not use shell=True
except subprocess.CalledProcessError as e:
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
return e.output
def selectFromFileDialog(fileName, waitForFile=False):
if platform.system() == "Darwin":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment