diff options
author | Christian Stenger <christian.stenger@qt.io> | 2016-05-24 12:39:30 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2016-05-27 04:35:49 +0000 |
commit | e564abdd9a14997a458d3e917bfc30345e01b361 (patch) | |
tree | 915aade724716b3cc09ed3597d349d5cc937ab62 | |
parent | a00a73a74d00fce066494d0ba44f55f69049b7e7 (diff) | |
download | qt-creator-e564abdd9a14997a458d3e917bfc30345e01b361.tar.gz |
Squish: Use more stable subprocess code
Change-Id: I9a895831f9d57562a9eeb8491cc7f46c1da2eba1
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
-rw-r--r-- | tests/system/shared/utils.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index a8ddd7b23e..85cfb2f096 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -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": |