[lit] Make string encoding issues explicit.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 7 Aug 2013 23:09:55 +0000 (23:09 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 7 Aug 2013 23:09:55 +0000 (23:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187931 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/ProgressBar.py
utils/lit/lit/TestFormats.py

index 0454ba29a43e9676c3aafa6863db766dcff1e76b..2481bdfefa961a622fc783ebd46478337ff0d2f3 100644 (file)
@@ -135,7 +135,11 @@ class TerminalController:
         # For any modern terminal, we should be able to just ignore
         # these, so strip them out.
         import curses
-        cap = curses.tigetstr(cap_name) or ''
+        cap = curses.tigetstr(cap_name)
+        if cap is None:
+            cap = ''
+        else:
+            cap = cap.decode('ascii')
         return re.sub(r'\$<\d+>[/*]?', '', cap)
 
     def render(self, template):
index 9e0c7a0be7ac66b152f380aba9acea4db1dd4cdd..9c43a216b2c81dc0c6a9ae9695d1439a83d923bf 100644 (file)
@@ -30,6 +30,7 @@ class GoogleTest(object):
         try:
             lines = lit.Util.capture([path, '--gtest_list_tests'],
                                      env=localConfig.environment)
+            lines = lines.decode('ascii')
             if kIsWindows:
               lines = lines.replace('\r', '')
             lines = lines.split('\n')