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


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to