summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sequeira <phsequei@gmail.com>2014-06-13 14:12:06 -0400
committerwm4 <wm4@nowhere>2014-06-14 14:07:24 +0200
commit4c97c3a1b30f29d622722ebece72b78da55ef6a4 (patch)
treea337ad94fdb9a80474dbf9f539a47c4513880fca
parent4b36023273bbb099750ad2af705115880e3d5588 (diff)
downloadmpv-4c97c3a1b30f29d622722ebece72b78da55ef6a4.tar.bz2
mpv-4c97c3a1b30f29d622722ebece72b78da55ef6a4.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.
-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