[llvm] r187931 - [lit] Make string encoding issues explicit.

Daniel Dunbar daniel at zuster.org
Wed Aug 7 16:09:55 PDT 2013


Author: ddunbar
Date: Wed Aug  7 18:09:55 2013
New Revision: 187931

URL: http://llvm.org/viewvc/llvm-project?rev=187931&view=rev
Log:
[lit] Make string encoding issues explicit.

Modified:
    llvm/trunk/utils/lit/lit/ProgressBar.py
    llvm/trunk/utils/lit/lit/TestFormats.py

Modified: llvm/trunk/utils/lit/lit/ProgressBar.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/ProgressBar.py?rev=187931&r1=187930&r2=187931&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/ProgressBar.py (original)
+++ llvm/trunk/utils/lit/lit/ProgressBar.py Wed Aug  7 18:09:55 2013
@@ -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):

Modified: llvm/trunk/utils/lit/lit/TestFormats.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestFormats.py?rev=187931&r1=187930&r2=187931&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestFormats.py (original)
+++ llvm/trunk/utils/lit/lit/TestFormats.py Wed Aug  7 18:09:55 2013
@@ -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')





More information about the llvm-commits mailing list