projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8769778
)
lit/util.py: Another fix for py3.
author
NAKAMURA Takumi
<geek4civic@gmail.com>
Mon, 5 Sep 2016 00:00:40 +0000
(
00:00
+0000)
committer
NAKAMURA Takumi
<geek4civic@gmail.com>
Mon, 5 Sep 2016 00:00:40 +0000
(
00:00
+0000)
'str' object has no attribute 'decode'.
llvm-svn: 280641
llvm/utils/lit/lit/util.py
patch
|
blob
|
history
diff --git
a/llvm/utils/lit/lit/util.py
b/llvm/utils/lit/lit/util.py
index
79eedfa
..
d3187e3
100644
(file)
--- a/
llvm/utils/lit/lit/util.py
+++ b/
llvm/utils/lit/lit/util.py
@@
-20,6
+20,8
@@
def to_string(bytes):
def convert_string(bytes):
try:
return to_string(bytes.decode('utf-8'))
+ except AttributeError: # 'str' object has no attribute 'decode'.
+ return str(bytes)
except UnicodeError:
return str(bytes)