From 14b231119d2c125bcdcba48d159a78097152e387 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Feb 2015 09:40:50 +0100 Subject: 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. --- waftools/waf_customizations.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3