[llvm] r329020 - [lit] Use io.open to compare two files since it supports different encodings while older versions of open do not

Aaron Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 14:44:51 PDT 2018


Author: asmith
Date: Mon Apr  2 14:44:51 2018
New Revision: 329020

URL: http://llvm.org/viewvc/llvm-project?rev=329020&view=rev
Log:
[lit] Use io.open to compare two files since it supports different encodings while older versions of open do not

Modified:
    llvm/trunk/utils/lit/lit/TestRunner.py

Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=329020&r1=329019&r2=329020&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Mon Apr  2 14:44:51 2018
@@ -388,7 +388,7 @@ def executeBuiltinDiff(cmd, cmd_shenv):
     def compareTwoFiles(filepaths):
         filelines = []
         for file in filepaths:
-            with open(file, 'r') as f:
+            with io.open(file, 'r') as f:
                 filelines.append(f.readlines())
 
         exitCode = 0 




More information about the llvm-commits mailing list