[lit] Use io.open to compare two files since it supports different encodings while...
authorAaron Smith <aaron.smith@microsoft.com>
Mon, 2 Apr 2018 21:44:51 +0000 (21:44 +0000)
committerAaron Smith <aaron.smith@microsoft.com>
Mon, 2 Apr 2018 21:44:51 +0000 (21:44 +0000)
llvm-svn: 329020

llvm/utils/lit/lit/TestRunner.py

index ce9e0a0..757d01a 100644 (file)
@@ -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