diff options
author | wm4 <wm4@nowhere> | 2015-02-19 09:40:50 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-19 09:40:50 +0100 |
commit | 14b231119d2c125bcdcba48d159a78097152e387 (patch) | |
tree | 028cf2d4d0cea4707daf2f14e0042c32d0dad92a /waftools/waf_customizations.py | |
parent | a34d3318419da53c145830432a4334949fdc82c9 (diff) | |
download | mpv-14b231119d2c125bcdcba48d159a78097152e387.tar.bz2 mpv-14b231119d2c125bcdcba48d159a78097152e387.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.
Diffstat (limited to 'waftools/waf_customizations.py')
-rw-r--r-- | waftools/waf_customizations.py | 8 |
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): |