summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-19 09:40:50 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-19 19:33:49 +0900
commit07222d14f9518c4094487951a269a04000e56c3e (patch)
tree8e970a7a916a6bba38168cc6436c3f8de91bf100
parent28fbee7f033eaa5dfb193850f4783088b5f48034 (diff)
downloadmpv-07222d14f9518c4094487951a269a04000e56c3e.tar.bz2
mpv-07222d14f9518c4094487951a269a04000e56c3e.tar.xz
build: fix Python 3 unicode issue with waf 1.8.6
Starting with waf 1.8.6 (in Python 3), the hcode variable isn't a string, but a byte string. This commit adds the solution proposed in the upstream waf bug report: https://code.google.com/p/waf/issues/detail?id=1535 It seems a bit overly verbose, but on the other hand, this solution has the chance of being most correct/compatible. Fixes #1604. (cherry picked from commit 14b231119d2c125bcdcba48d159a78097152e387)
-rw-r--r--waftools/waf_customizations.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/waftools/waf_customizations.py b/waftools/waf_customizations.py
index 8163c9ffb4..fb5f130276 100644
--- a/waftools/waf_customizations.py
+++ b/waftools/waf_customizations.py
@@ -33,7 +33,13 @@ def build(ctx):
cls = Task.classes['cprogram']
class cprogram(cls):
- run_str = cls.hcode + '${LAST_LINKFLAGS}'
+ try:
+ run_str = cls.orig_run_str + '${LAST_LINKFLAGS}'
+ except AttributeError:
+ try:
+ run_str = cls.hcode + '${LAST_LINKFLAGS}'
+ except TypeError:
+ run_str = cls.hcode.decode('iso8859-1') + '${LAST_LINKFLAGS}'
cls = Task.classes['macplist']
class macplist(cls):