[Lldb-commits] [lldb] r354414 - [testsuite] Fix TestUnicodeString to work with Py2 and Py3.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 19 16:54:07 PST 2019


Author: davide
Date: Tue Feb 19 16:54:07 2019
New Revision: 354414

URL: http://llvm.org/viewvc/llvm-project?rev=354414&view=rev
Log:
[testsuite] Fix TestUnicodeString to work with Py2 and Py3.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py?rev=354414&r1=354413&r2=354414&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py Tue Feb 19 16:54:07 2019
@@ -5,6 +5,7 @@ from __future__ import absolute_import
 import os
 
 # Third-party modules
+import io
 
 # LLDB modules
 import lldb
@@ -13,7 +14,6 @@ from . import configuration
 from . import lldbutil
 from .decorators import *
 
-
 def source_type(filename):
     _, extension = os.path.splitext(filename)
     return {
@@ -45,7 +45,7 @@ class CommandParser:
 
     def parse_source_files(self, source_files):
         for source_file in source_files:
-            file_handle = open(source_file)
+            file_handle = io.open(source_file, encoding='utf-8')
             lines = file_handle.readlines()
             line_number = 0
             # non-NULL means we're looking through whitespace to find




More information about the lldb-commits mailing list