Skip to content

Commit 19601ef

Browse files
authored
gh-109653: Remove unused imports in the Lib/ directory (#109803)
1 parent 649768f commit 19601ef

20 files changed

+6
-25
lines changed

Lib/asyncio/tasks.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import itertools
1818
import math
1919
import types
20-
import warnings
2120
import weakref
2221
from types import GenericAlias
2322

Lib/test/mapping_tests.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# tests common to dict and UserDict
22
import unittest
33
import collections
4-
import sys
54
from test.support import Py_C_RECURSION_LIMIT
65

76

Lib/test/support/interpreters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import _xxinterpchannels as _channels
66

77
# aliases:
8-
from _xxsubinterpreters import is_shareable, RunFailedError
8+
from _xxsubinterpreters import is_shareable
99
from _xxinterpchannels import (
1010
ChannelError, ChannelNotFoundError, ChannelEmptyError,
1111
)

Lib/test/test_asyncio/test_eager_task_factory.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from unittest import mock
88
from asyncio import tasks
99
from test.test_asyncio import utils as test_utils
10-
import test.support
1110
from test.support.script_helper import assert_python_ok
1211

1312
MOCK_ANY = mock.ANY

Lib/test/test_capi/test_abstract.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import unittest
2-
import sys
32
from collections import OrderedDict
4-
from test import support
5-
from test.support import import_helper
63
import _testcapi
74

85

Lib/test/test_capi/test_dict.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import unittest
2-
import sys
32
from collections import OrderedDict, UserDict
43
from types import MappingProxyType
5-
from test import support
6-
from test.support import import_helper
74
import _testcapi
85

96

Lib/test/test_capi/test_misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# these are all functions _testcapi exports whose name begins with 'test_'.
33

44
import _thread
5-
from collections import OrderedDict, deque
5+
from collections import deque
66
import contextlib
77
import importlib.machinery
88
import importlib.util

Lib/test/test_csv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import gc
1111
import pickle
1212
from test import support
13-
from test.support import warnings_helper, import_helper, check_disallow_instantiation
13+
from test.support import import_helper, check_disallow_instantiation
1414
from itertools import permutations
1515
from textwrap import dedent
1616
from collections import OrderedDict

Lib/test/test_decimal.py

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
darwin_malloc_err_warning, is_emscripten)
4242
from test.support.import_helper import import_fresh_module
4343
from test.support import threading_helper
44-
from test.support import warnings_helper
4544
import random
4645
import inspect
4746
import threading

Lib/test/test_dictviews.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import collections.abc
22
import copy
33
import pickle
4-
import sys
54
import unittest
65
from test.support import Py_C_RECURSION_LIMIT
76

Lib/test/test_gdb.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Lib/test/test_jit_gdb.py
55

66
import os
7-
import platform
87
import re
98
import subprocess
109
import sys

Lib/test/test_importlib/import_/test_packages.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from test.test_importlib import util
22
import sys
33
import unittest
4-
from test import support
54
from test.support import import_helper
65

76

Lib/test/test_peg_generator/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os.path
2-
import unittest
32
from test import support
43
from test.support import load_package_tests
54

Lib/test/test_pyexpat.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# handler, are obscure and unhelpful.
33

44
import os
5-
import platform
65
import sys
76
import sysconfig
87
import unittest
@@ -14,7 +13,7 @@
1413
from xml.parsers import expat
1514
from xml.parsers.expat import errors
1615

17-
from test.support import sortdict, is_emscripten, is_wasi
16+
from test.support import sortdict
1817

1918

2019
class SetAttributeTest(unittest.TestCase):

Lib/test/test_sqlite3/test_dump.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Author: Paul Kippes <kippesp@gmail.com>
22

33
import unittest
4-
import sqlite3 as sqlite
54

65
from .util import memory_database
76
from .util import MemoryDatabaseMixin

Lib/test/test_sqlite3/test_userfunctions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from test.support import bigmemtest, gc_collect
3030

3131
from .util import cx_limit, memory_database
32-
from .util import with_tracebacks, check_tracebacks
32+
from .util import with_tracebacks
3333

3434

3535
def func_returntext():

Lib/test/test_sqlite3/util.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import re
55
import sqlite3
66
import test.support
7-
import unittest
87

98

109
# Helper for temporary memory databases

Lib/test/test_tkinter/support.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import functools
22
import tkinter
3-
import unittest
43

54
class AbstractTkTest:
65

Lib/test/test_unittest/testmock/testthreadingmock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import concurrent.futures
44

55
from test.support import threading_helper
6-
from unittest.mock import patch, ThreadingMock, call
6+
from unittest.mock import patch, ThreadingMock
77

88

99
threading_helper.requires_working_threading(module=True)

Lib/test/test_zlib.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from test.support import import_helper
44
import binascii
55
import copy
6-
import os
76
import pickle
87
import random
98
import sys

0 commit comments

Comments
 (0)