summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-09-24 14:07:23 (GMT)
committerGitHub <noreply@github.com>2023-09-24 14:07:23 (GMT)
commit19601efa364fe3c294d8010effe11e025cbc230e (patch)
treefe7b91cda272516296be6a0fb4fc31ce6c9037a8
parent649768fb6781ba810df44017fee1975a11d65e2f (diff)
downloadcpython-19601efa364fe3c294d8010effe11e025cbc230e.zip
cpython-19601efa364fe3c294d8010effe11e025cbc230e.tar.gz
cpython-19601efa364fe3c294d8010effe11e025cbc230e.tar.bz2
gh-109653: Remove unused imports in the `Lib/` directory (#109803)
-rw-r--r--Lib/asyncio/tasks.py1
-rw-r--r--Lib/test/mapping_tests.py1
-rw-r--r--Lib/test/support/interpreters.py2
-rw-r--r--Lib/test/test_asyncio/test_eager_task_factory.py1
-rw-r--r--Lib/test/test_capi/test_abstract.py3
-rw-r--r--Lib/test/test_capi/test_dict.py3
-rw-r--r--Lib/test/test_capi/test_misc.py2
-rw-r--r--Lib/test/test_csv.py2
-rw-r--r--Lib/test/test_decimal.py1
-rw-r--r--Lib/test/test_dictviews.py1
-rw-r--r--Lib/test/test_gdb.py1
-rw-r--r--Lib/test/test_importlib/import_/test_packages.py1
-rw-r--r--Lib/test/test_peg_generator/__init__.py1
-rw-r--r--Lib/test/test_pyexpat.py3
-rw-r--r--Lib/test/test_sqlite3/test_dump.py1
-rw-r--r--Lib/test/test_sqlite3/test_userfunctions.py2
-rw-r--r--Lib/test/test_sqlite3/util.py1
-rw-r--r--Lib/test/test_tkinter/support.py1
-rw-r--r--Lib/test/test_unittest/testmock/testthreadingmock.py2
-rw-r--r--Lib/test/test_zlib.py1
20 files changed, 6 insertions, 25 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index edc64fd..21a1b24 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -17,7 +17,6 @@ import inspect
import itertools
import math
import types
-import warnings
import weakref
from types import GenericAlias
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index b3e4192..b4cfce1 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -1,7 +1,6 @@
# tests common to dict and UserDict
import unittest
import collections
-import sys
from test.support import Py_C_RECURSION_LIMIT
diff --git a/Lib/test/support/interpreters.py b/Lib/test/support/interpreters.py
index 5c484d1..eeff3ab 100644
--- a/Lib/test/support/interpreters.py
+++ b/Lib/test/support/interpreters.py
@@ -5,7 +5,7 @@ import _xxsubinterpreters as _interpreters
import _xxinterpchannels as _channels
# aliases:
-from _xxsubinterpreters import is_shareable, RunFailedError
+from _xxsubinterpreters import is_shareable
from _xxinterpchannels import (
ChannelError, ChannelNotFoundError, ChannelEmptyError,
)
diff --git a/Lib/test/test_asyncio/test_eager_task_factory.py b/Lib/test/test_asyncio/test_eager_task_factory.py
index fc9ad8e..0f8212d 100644
--- a/Lib/test/test_asyncio/test_eager_task_factory.py
+++ b/Lib/test/test_asyncio/test_eager_task_factory.py
@@ -7,7 +7,6 @@ import unittest
from unittest import mock
from asyncio import tasks
from test.test_asyncio import utils as test_utils
-import test.support
from test.support.script_helper import assert_python_ok
MOCK_ANY = mock.ANY
diff --git a/Lib/test/test_capi/test_abstract.py b/Lib/test/test_capi/test_abstract.py
index 7fad853..eeaef60 100644
--- a/Lib/test/test_capi/test_abstract.py
+++ b/Lib/test/test_capi/test_abstract.py
@@ -1,8 +1,5 @@
import unittest
-import sys
from collections import OrderedDict
-from test import support
-from test.support import import_helper
import _testcapi
diff --git a/Lib/test/test_capi/test_dict.py b/Lib/test/test_capi/test_dict.py
index b22fa20..11b2ca9 100644
--- a/Lib/test/test_capi/test_dict.py
+++ b/Lib/test/test_capi/test_dict.py
@@ -1,9 +1,6 @@
import unittest
-import sys
from collections import OrderedDict, UserDict
from types import MappingProxyType
-from test import support
-from test.support import import_helper
import _testcapi
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py
index cf1cba3..5ece213 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -2,7 +2,7 @@
# these are all functions _testcapi exports whose name begins with 'test_'.
import _thread
-from collections import OrderedDict, deque
+from collections import deque
import contextlib
import importlib.machinery
import importlib.util
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index 27f4978..97b9bba 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -10,7 +10,7 @@ import csv
import gc
import pickle
from test import support
-from test.support import warnings_helper, import_helper, check_disallow_instantiation
+from test.support import import_helper, check_disallow_instantiation
from itertools import permutations
from textwrap import dedent
from collections import OrderedDict
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index d806eea..bd29948 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -41,7 +41,6 @@ from test.support import (TestFailed,
darwin_malloc_err_warning, is_emscripten)
from test.support.import_helper import import_fresh_module
from test.support import threading_helper
-from test.support import warnings_helper
import random
import inspect
import threading
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
index 3491858..cad568b 100644
--- a/Lib/test/test_dictviews.py
+++ b/Lib/test/test_dictviews.py
@@ -1,7 +1,6 @@
import collections.abc
import copy
import pickle
-import sys
import unittest
from test.support import Py_C_RECURSION_LIMIT
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 914ef94..5a4394a 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -4,7 +4,6 @@
# Lib/test/test_jit_gdb.py
import os
-import platform
import re
import subprocess
import sys
diff --git a/Lib/test/test_importlib/import_/test_packages.py b/Lib/test/test_importlib/import_/test_packages.py
index eb0831f..0c29d60 100644
--- a/Lib/test/test_importlib/import_/test_packages.py
+++ b/Lib/test/test_importlib/import_/test_packages.py
@@ -1,7 +1,6 @@
from test.test_importlib import util
import sys
import unittest
-from test import support
from test.support import import_helper
diff --git a/Lib/test/test_peg_generator/__init__.py b/Lib/test/test_peg_generator/__init__.py
index c23542e..b32db44 100644
--- a/Lib/test/test_peg_generator/__init__.py
+++ b/Lib/test/test_peg_generator/__init__.py
@@ -1,5 +1,4 @@
import os.path
-import unittest
from test import support
from test.support import load_package_tests
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 41f4d17..a542aba 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -2,7 +2,6 @@
# handler, are obscure and unhelpful.
import os
-import platform
import sys
import sysconfig
import unittest
@@ -14,7 +13,7 @@ from test.support import os_helper
from xml.parsers import expat
from xml.parsers.expat import errors
-from test.support import sortdict, is_emscripten, is_wasi
+from test.support import sortdict
class SetAttributeTest(unittest.TestCase):
diff --git a/Lib/test/test_sqlite3/test_dump.py b/Lib/test/test_sqlite3/test_dump.py
index 3107e1b..14a18c1 100644
--- a/Lib/test/test_sqlite3/test_dump.py
+++ b/Lib/test/test_sqlite3/test_dump.py
@@ -1,7 +1,6 @@
# Author: Paul Kippes <kippesp@gmail.com>
import unittest
-import sqlite3 as sqlite
from .util import memory_database
from .util import MemoryDatabaseMixin
diff --git a/Lib/test/test_sqlite3/test_userfunctions.py b/Lib/test/test_sqlite3/test_userfunctions.py
index 0901949..c6c3db1 100644
--- a/Lib/test/test_sqlite3/test_userfunctions.py
+++ b/Lib/test/test_sqlite3/test_userfunctions.py
@@ -29,7 +29,7 @@ from unittest.mock import Mock, patch
from test.support import bigmemtest, gc_collect
from .util import cx_limit, memory_database
-from .util import with_tracebacks, check_tracebacks
+from .util import with_tracebacks
def func_returntext():
diff --git a/Lib/test/test_sqlite3/util.py b/Lib/test/test_sqlite3/util.py
index 505406c..5599823 100644
--- a/Lib/test/test_sqlite3/util.py
+++ b/Lib/test/test_sqlite3/util.py
@@ -4,7 +4,6 @@ import io
import re
import sqlite3
import test.support
-import unittest
# Helper for temporary memory databases
diff --git a/Lib/test/test_tkinter/support.py b/Lib/test/test_tkinter/support.py
index 10e64bf..a37705f 100644
--- a/Lib/test/test_tkinter/support.py
+++ b/Lib/test/test_tkinter/support.py
@@ -1,6 +1,5 @@
import functools
import tkinter
-import unittest
class AbstractTkTest:
diff --git a/Lib/test/test_unittest/testmock/testthreadingmock.py b/Lib/test/test_unittest/testmock/testthreadingmock.py
index 94e7192..a02b532 100644
--- a/Lib/test/test_unittest/testmock/testthreadingmock.py
+++ b/Lib/test/test_unittest/testmock/testthreadingmock.py
@@ -3,7 +3,7 @@ import unittest
import concurrent.futures
from test.support import threading_helper
-from unittest.mock import patch, ThreadingMock, call
+from unittest.mock import patch, ThreadingMock
threading_helper.requires_working_threading(module=True)
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 55306c6..9a099ad 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -3,7 +3,6 @@ from test import support
from test.support import import_helper
import binascii
import copy
-import os
import pickle
import random
import sys