From b50baa1c4bc30d704cd1fdf81bc4932a83839ca6 Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Mon, 2 Apr 2018 21:44:51 +0000 Subject: [PATCH] [lit] Use io.open to compare two files since it supports different encodings while older versions of open do not llvm-svn: 329020 --- llvm/utils/lit/lit/TestRunner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index ce9e0a0b88b2..757d01ac47d0 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -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