[lit] Fix import StringIO errors in Python 3

Remove the cStringIO micro-optimization, as it isn't portable to Python
3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2017-07-11 16:12:53 +00:00
parent dbeb61f22e
commit 05c2cd15d0

View File

@@ -6,9 +6,9 @@ import tempfile
import threading
try:
import cStringIO as StringIO
from StringIO import StringIO
except ImportError:
import StringIO
from io import StringIO
from lit.ShCommands import GlobItem
import lit.ShUtil as ShUtil
@@ -240,7 +240,7 @@ def executeBuiltinEcho(cmd, shenv):
is_redirected = True
if stdout == subprocess.PIPE:
is_redirected = False
stdout = StringIO.StringIO()
stdout = StringIO()
elif kIsWindows:
# Reopen stdout in binary mode to avoid CRLF translation. The versions
# of echo we are replacing on Windows all emit plain LF, and the LLVM