Skip to content

Commit e488e30

Browse files
authored
bpo-40443: Remove unused imports in distutils (GH-19802)
1 parent 9054967 commit e488e30

11 files changed

+6
-17
lines changed

Lib/distutils/_msvccompiler.py

-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# ported to VS 2015 by Steve Dower
1515

1616
import os
17-
import shutil
18-
import stat
1917
import subprocess
2018
import winreg
2119

@@ -65,8 +63,6 @@ def _find_vc2017():
6563
If vswhere.exe is not available, by definition, VS 2017 is not
6664
installed.
6765
"""
68-
import json
69-
7066
root = os.environ.get("ProgramFiles(x86)") or os.environ.get("ProgramFiles")
7167
if not root:
7268
return None, None

Lib/distutils/bcppcompiler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
import os
1616
from distutils.errors import \
17-
DistutilsExecError, DistutilsPlatformError, \
17+
DistutilsExecError, \
1818
CompileError, LibError, LinkError, UnknownFileError
1919
from distutils.ccompiler import \
20-
CCompiler, gen_preprocess_options, gen_lib_options
20+
CCompiler, gen_preprocess_options
2121
from distutils.file_util import write_file
2222
from distutils.dep_util import newer
2323
from distutils import log

Lib/distutils/ccompiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from distutils.spawn import spawn
99
from distutils.file_util import move_file
1010
from distutils.dir_util import mkpath
11-
from distutils.dep_util import newer_pairwise, newer_group
11+
from distutils.dep_util import newer_group
1212
from distutils.util import split_quoted, execute
1313
from distutils import log
1414

Lib/distutils/command/bdist_rpm.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import subprocess, sys, os
77
from distutils.core import Command
88
from distutils.debug import DEBUG
9-
from distutils.util import get_platform
109
from distutils.file_util import write_file
1110
from distutils.errors import *
1211
from distutils.sysconfig import get_python_version

Lib/distutils/command/bdist_wininst.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import warnings
99
from distutils.core import Command
1010
from distutils.util import get_platform
11-
from distutils.dir_util import create_tree, remove_tree
11+
from distutils.dir_util import remove_tree
1212
from distutils.errors import *
1313
from distutils.sysconfig import get_python_version
1414
from distutils import log

Lib/distutils/command/check.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from docutils.parsers.rst import Parser
1212
from docutils import frontend
1313
from docutils import nodes
14-
from io import StringIO
1514

1615
class SilentReporter(Reporter):
1716

Lib/distutils/command/upload.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import os
99
import io
10-
import platform
1110
import hashlib
1211
from base64 import standard_b64encode
1312
from urllib.request import urlopen, Request, HTTPError

Lib/distutils/cygwinccompiler.py

-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@
5151
from subprocess import Popen, PIPE, check_output
5252
import re
5353

54-
from distutils.ccompiler import gen_preprocess_options, gen_lib_options
5554
from distutils.unixccompiler import UnixCCompiler
5655
from distutils.file_util import write_file
5756
from distutils.errors import (DistutilsExecError, CCompilerError,
5857
CompileError, UnknownFileError)
59-
from distutils import log
6058
from distutils.version import LooseVersion
6159
from distutils.spawn import find_executable
6260

Lib/distutils/msvc9compiler.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
2121
CompileError, LibError, LinkError
22-
from distutils.ccompiler import CCompiler, gen_preprocess_options, \
23-
gen_lib_options
22+
from distutils.ccompiler import CCompiler, gen_lib_options
2423
from distutils import log
2524
from distutils.util import get_platform
2625

Lib/distutils/msvccompiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DistutilsExecError, DistutilsPlatformError, \
1414
CompileError, LibError, LinkError
1515
from distutils.ccompiler import \
16-
CCompiler, gen_preprocess_options, gen_lib_options
16+
CCompiler, gen_lib_options
1717
from distutils import log
1818

1919
_can_read_reg = False

Lib/distutils/sysconfig.py

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import sys
1616

1717
from .errors import DistutilsPlatformError
18-
from .util import get_platform, get_host_platform
1918

2019
# These are needed in a couple of spots, so just compute them once.
2120
PREFIX = os.path.normpath(sys.prefix)

0 commit comments

Comments
 (0)