summaryrefslogtreecommitdiffstats
path: root/waftools
diff options
context:
space:
mode:
authorPhilip Sequeira <phsequei@gmail.com>2014-06-13 14:12:06 -0400
committerwm4 <wm4@nowhere>2014-06-14 10:11:07 +0200
commita7293b92f41e201581a04c3bcc1d451038c269e2 (patch)
tree26805d4bfa1dd2c127c72f029d40cb0fbbeaaffc /waftools
parentf193d25844c62a04d489342942a9339cabd03b28 (diff)
downloadmpv-a7293b92f41e201581a04c3bcc1d451038c269e2.tar.bz2
mpv-a7293b92f41e201581a04c3bcc1d451038c269e2.tar.xz
build: version string as native str type for each Python version
Should resolve the "mpv b'...'" issue on Python 3 without breaking things on Python 2. Also, remove redundant wait for process.
Diffstat (limited to 'waftools')
-rw-r--r--waftools/generators/headers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/waftools/generators/headers.py b/waftools/generators/headers.py
index 8c164cca73..b38fcb88f4 100644
--- a/waftools/generators/headers.py
+++ b/waftools/generators/headers.py
@@ -4,9 +4,11 @@ def __get_version__(ctx):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=ctx.srcnode.abspath())
- process.wait()
(version, err) = process.communicate()
- return version.strip().decode('utf-8').encode('ascii', 'ignore')
+ version = version.strip()
+ if not isinstance(version, str):
+ version = version.decode('utf-8')
+ return version
def __get_build_date__():
import time