From 8113778aab198c2b25aa37f20638dfc6f6272174 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 21 Nov 2015 17:17:16 +0100 Subject: [PATCH] Undefined name 'unicode' in the new json methods --- waflib/Node.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/waflib/Node.py b/waflib/Node.py index 925251f4..fb3cd273 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -167,12 +167,16 @@ class Node(object): """ import json # Python 2.6 and up object_pairs_hook = None - if convert and sys.hexversion < 0x3000000: + try: + _type = unicode + except NameError: + _type = str + def convert(value): if isinstance(value, list): return [convert(element) for element in value] - elif isinstance(value, unicode): + elif isinstance(value, _type): return str(value) else: return value