From 4061732e88b4a335215771c6424c14770cffb523 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 5 Sep 2016 00:00:40 +0000 Subject: [PATCH] lit/util.py: Another fix for py3. 'str' object has no attribute 'decode'. llvm-svn: 280641 --- utils/lit/lit/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/lit/lit/util.py b/utils/lit/lit/util.py index 79eedfa18d4..d3187e3c3b3 100644 --- a/utils/lit/lit/util.py +++ b/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)