From 9fa6e0aa95a98d5608f9731155fad1db4c32f67b Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 25 Oct 2014 01:08:38 +0200 Subject: [PATCH] Issue 1503 - 'unicode' built-in handling in python3 --- waflib/extras/codelite.py | 4 ++-- waflib/extras/msvs.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/waflib/extras/codelite.py b/waflib/extras/codelite.py index 6f1a2376..56219cfd 100644 --- a/waflib/extras/codelite.py +++ b/waflib/extras/codelite.py @@ -303,13 +303,13 @@ def rm_blank_lines(txt): BOM = '\xef\xbb\xbf' try: BOM = bytes(BOM, 'iso8859-1') # python 3 -except: +except NameError: pass def stealth_write(self, data, flags='wb'): try: x = unicode - except: + except NameError: data = data.encode('utf-8') # python 3 else: data = data.decode(sys.getfilesystemencoding(), 'replace') diff --git a/waflib/extras/msvs.py b/waflib/extras/msvs.py index 6fae3045..0184f31d 100644 --- a/waflib/extras/msvs.py +++ b/waflib/extras/msvs.py @@ -358,7 +358,7 @@ except TypeError: def stealth_write(self, data, flags='wb'): try: x = unicode - except AttributeError: + except NameError: data = data.encode('utf-8') # python 3 else: data = data.decode(sys.getfilesystemencoding(), 'replace')