[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.
This commit is contained in:
David Spickett
2025-10-31 09:45:55 +00:00
committed by GitHub
parent 1e7c082524
commit 94f3eeee94
5 changed files with 8 additions and 28 deletions

View File

@@ -29,11 +29,7 @@ import socket
import itertools
import Reporter
try:
import configparser
except ImportError:
import ConfigParser as configparser
import configparser
###
# Various patterns matched or replaced by server.

View File

@@ -56,11 +56,7 @@ import shutil
import subprocess
import sys
import tempfile
try:
import configparser
except ImportError:
import ConfigParser as configparser
import configparser
import io
import obj_diff

View File

@@ -1,9 +1,5 @@
import os
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import configparser
import lit.formats
import lit.Test
@@ -16,7 +12,7 @@ class DummyFormat(lit.formats.FileBasedTest):
source_path = test.getSourcePath()
cfg = ConfigParser.ConfigParser()
cfg = configparser.ConfigParser()
cfg.read(source_path)
# Create the basic test result.

View File

@@ -1,9 +1,5 @@
import os
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import configparser
import lit.formats
import lit.Test
@@ -16,7 +12,7 @@ class DummyFormat(lit.formats.FileBasedTest):
source_path = test.getSourcePath()
cfg = ConfigParser.ConfigParser()
cfg = configparser.ConfigParser()
cfg.read(source_path)
# Create the basic test result.

View File

@@ -1,9 +1,5 @@
import os
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import configparser
import lit.formats
import lit.Test
@@ -16,7 +12,7 @@ class DummyFormat(lit.formats.FileBasedTest):
source_path = test.getSourcePath()
cfg = ConfigParser.ConfigParser()
cfg = configparser.ConfigParser()
cfg.read(source_path)
# Create the basic test result.