Skip to content

Commit 7058657

Browse files
[lit] Remove StringIO imports
StringIO was moved to io.StringIO in Python 3. These try/catch statements were intended to provide cross compatibility between the two. Now that LLVM's minimum required Python version is 3.8 and Python 2 has been deprecated for a while, we can probably drop support. Especially since there is no upstream testing for this configuration.
1 parent 722d96f commit 7058657

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

lit/TestRunner.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
import typing
1616
import traceback
1717
from typing import Optional, Tuple
18-
19-
import io
20-
21-
try:
22-
from StringIO import StringIO
23-
except ImportError:
24-
from io import StringIO
18+
from io import StringIO
2519

2620
from lit.ShCommands import GlobItem, Command
2721
import lit.ShUtil as ShUtil

lit/builtin_commands/cat.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import getopt
22
import sys
3-
4-
try:
5-
from StringIO import StringIO
6-
except ImportError:
7-
from io import StringIO
3+
from io import StringIO
84

95

106
def convertToCaretAndMNotation(data):

0 commit comments

Comments
 (0)