[lit] Attempt to fix builtin diff code for Python 2

llvm-svn: 329024
This commit is contained in:
Reid Kleckner 2018-04-02 22:19:42 +00:00
parent 24a77396a9
commit 30b215e8f7
1 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import shutil
import tempfile
import threading
import io
try:
from StringIO import StringIO
except ImportError:
@ -388,6 +389,8 @@ def executeBuiltinDiff(cmd, cmd_shenv):
def compareTwoFiles(filepaths):
filelines = []
for file in filepaths:
compare_bytes = False
encoding = None
try:
with open(file, 'r') as f:
filelines.append(f.readlines())