2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-23 09:45:13 +01:00

Issue 1503 - 'unicode' built-in handling in python3

This commit is contained in:
Thomas Nagy 2014-10-25 01:08:38 +02:00
parent 86b25fa523
commit 9fa6e0aa95
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 3 additions and 3 deletions

View File

@ -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')

View File

@ -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')