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:
parent
86b25fa523
commit
9fa6e0aa95
@ -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')
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user