Skip to content

Commit 94f3eee

Browse files
[llvm][clang] Remove handling of Python2 ConfigParser module name (#163727)
LLVM now requires Python >= 3.8, and ConfigParser was renamed to configparser in 3.0: https://docs.python.org/3/whatsnew/3.0.html#library-changes A few places imported it under the Python2 name even for Python3, I have swapped those to the Python3 name. This was reported by https://pypi.org/project/vermin/ as the file having incompatible versions. Since once import is 2.x and one is 3.x.
1 parent 1e7c082 commit 94f3eee

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

clang/tools/scan-view/share/ScanView.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
import itertools
3030

3131
import Reporter
32-
33-
try:
34-
import configparser
35-
except ImportError:
36-
import ConfigParser as configparser
32+
import configparser
3733

3834
###
3935
# Various patterns matched or replaced by server.

clang/utils/check_cfc/check_cfc.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@
5656
import subprocess
5757
import sys
5858
import tempfile
59-
60-
try:
61-
import configparser
62-
except ImportError:
63-
import ConfigParser as configparser
59+
import configparser
6460
import io
6561

6662
import obj_diff

llvm/utils/lit/tests/Inputs/test-data-micro/dummy_format.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import os
2-
3-
try:
4-
import ConfigParser
5-
except ImportError:
6-
import configparser as ConfigParser
2+
import configparser
73

84
import lit.formats
95
import lit.Test
@@ -16,7 +12,7 @@ def execute(self, test, lit_config):
1612

1713
source_path = test.getSourcePath()
1814

19-
cfg = ConfigParser.ConfigParser()
15+
cfg = configparser.ConfigParser()
2016
cfg.read(source_path)
2117

2218
# Create the basic test result.

llvm/utils/lit/tests/Inputs/test-data/dummy_format.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import os
2-
3-
try:
4-
import ConfigParser
5-
except ImportError:
6-
import configparser as ConfigParser
2+
import configparser
73

84
import lit.formats
95
import lit.Test
@@ -16,7 +12,7 @@ def execute(self, test, lit_config):
1612

1713
source_path = test.getSourcePath()
1814

19-
cfg = ConfigParser.ConfigParser()
15+
cfg = configparser.ConfigParser()
2016
cfg.read(source_path)
2117

2218
# Create the basic test result.

llvm/utils/lit/tests/Inputs/xunit-output/dummy_format.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import os
2-
3-
try:
4-
import ConfigParser
5-
except ImportError:
6-
import configparser as ConfigParser
2+
import configparser
73

84
import lit.formats
95
import lit.Test
@@ -16,7 +12,7 @@ def execute(self, test, lit_config):
1612

1713
source_path = test.getSourcePath()
1814

19-
cfg = ConfigParser.ConfigParser()
15+
cfg = configparser.ConfigParser()
2016
cfg.read(source_path)
2117

2218
# Create the basic test result.

0 commit comments

Comments
 (0)