summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-02-12 19:18:11 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-13 20:31:09 -0800
commitd0afd377096c1e6e2980ebf075a39d1aeb7e7c79 (patch)
tree253513d1ac92101b370c306f6e8053b481d9bbd9
parent8f9785d128eef0eae656d32d664ae1a8bff0bb12 (diff)
downloadmpv-d0afd377096c1e6e2980ebf075a39d1aeb7e7c79.tar.bz2
mpv-d0afd377096c1e6e2980ebf075a39d1aeb7e7c79.tar.xz
build: fix swift detection with python2
c82fed8 fixed the detection with python3 but broke it on python2. the decode function on python2 converts the str to unicode which causes problems when concatenating to str when building. instead of decoding the output we change the subprocess to operate in text mode. also use check_output instead of Popen for simplicity.
-rw-r--r--waftools/detections/compiler_swift.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/waftools/detections/compiler_swift.py b/waftools/detections/compiler_swift.py
index c1fe06117a..01349e820d 100644
--- a/waftools/detections/compiler_swift.py
+++ b/waftools/detections/compiler_swift.py
@@ -2,12 +2,8 @@ from waflib import Utils
def __run(cmd):
try:
- cmd = Utils.subprocess.Popen(cmd,
- stdout=Utils.subprocess.PIPE,
- stderr=Utils.subprocess.PIPE,
- shell=True)
- output = cmd.stdout.read().decode().strip()
- return output
+ output = Utils.subprocess.check_output(cmd, universal_newlines=True, shell=True)
+ return output.strip()
except Exception:
return ""