Skip to content

Commit 401d7a7

Browse files
authored
gh-102515: Remove unused imports in the Lib/ directory (#102516)
1 parent 7d801f2 commit 401d7a7

33 files changed

+8
-41
lines changed

Lib/_pylong.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
tricky or non-obvious code is not worth it. For people looking for
1313
maximum performance, they should use something like gmpy2."""
1414

15-
import sys
1615
import re
1716
import decimal
1817

Lib/concurrent/futures/process.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
from concurrent.futures import _base
5050
import queue
5151
import multiprocessing as mp
52+
# This import is required to load the multiprocessing.connection submodule
53+
# so that it can be accessed later as `mp.connection`
5254
import multiprocessing.connection
5355
from multiprocessing.queues import Queue
5456
import threading

Lib/dataclasses.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import types
55
import inspect
66
import keyword
7-
import builtins
87
import functools
98
import itertools
109
import abc

Lib/importlib/_abc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Subset of importlib.abc used to reduce importlib.util imports."""
22
from . import _bootstrap
33
import abc
4-
import warnings
54

65

76
class Loader(metaclass=abc.ABCMeta):

Lib/sysconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import sys
55
import threading
6-
from os.path import pardir, realpath
6+
from os.path import realpath
77

88
__all__ = [
99
'get_config_h_filename',

Lib/test/_test_venv_multiprocessing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import multiprocessing
22
import random
33
import sys
4-
import time
54

65
def fill_queue(queue, code):
76
queue.put(code)

Lib/test/fork_wait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
active threads survive in the child after a fork(); this is an error.
1010
"""
1111

12-
import os, sys, time, unittest
12+
import os, time, unittest
1313
import threading
1414
from test import support
1515
from test.support import threading_helper

Lib/test/test__xxinterpchannels.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections import namedtuple
22
import contextlib
3-
import os
43
import sys
54
from textwrap import dedent
65
import threading

Lib/test/test__xxsubinterpreters.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from collections import namedtuple
21
import contextlib
32
import itertools
43
import os
54
import pickle
65
import sys
76
from textwrap import dedent
87
import threading
9-
import time
108
import unittest
119

1210
import _testcapi

Lib/test/test_asyncgen.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import types
33
import unittest
44
import contextlib
5-
import warnings
65

76
from test.support.import_helper import import_module
87
from test.support import gc_collect, requires_working_socket

0 commit comments

Comments
 (0)