gh-109653: Remove unused imports in the Lib/ directory (#109803)

This commit is contained in:
Alex Waygood 2023-09-24 15:07:23 +01:00 committed by GitHub
parent 649768fb67
commit 19601efa36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 6 additions and 25 deletions

View file

@ -17,7 +17,6 @@ import inspect
import itertools import itertools
import math import math
import types import types
import warnings
import weakref import weakref
from types import GenericAlias from types import GenericAlias

View file

@ -1,7 +1,6 @@
# tests common to dict and UserDict # tests common to dict and UserDict
import unittest import unittest
import collections import collections
import sys
from test.support import Py_C_RECURSION_LIMIT from test.support import Py_C_RECURSION_LIMIT

View file

@ -5,7 +5,7 @@ import _xxsubinterpreters as _interpreters
import _xxinterpchannels as _channels import _xxinterpchannels as _channels
# aliases: # aliases:
from _xxsubinterpreters import is_shareable, RunFailedError from _xxsubinterpreters import is_shareable
from _xxinterpchannels import ( from _xxinterpchannels import (
ChannelError, ChannelNotFoundError, ChannelEmptyError, ChannelError, ChannelNotFoundError, ChannelEmptyError,
) )

View file

@ -7,7 +7,6 @@ import unittest
from unittest import mock from unittest import mock
from asyncio import tasks from asyncio import tasks
from test.test_asyncio import utils as test_utils from test.test_asyncio import utils as test_utils
import test.support
from test.support.script_helper import assert_python_ok from test.support.script_helper import assert_python_ok
MOCK_ANY = mock.ANY MOCK_ANY = mock.ANY

View file

@ -1,8 +1,5 @@
import unittest import unittest
import sys
from collections import OrderedDict from collections import OrderedDict
from test import support
from test.support import import_helper
import _testcapi import _testcapi

View file

@ -1,9 +1,6 @@
import unittest import unittest
import sys
from collections import OrderedDict, UserDict from collections import OrderedDict, UserDict
from types import MappingProxyType from types import MappingProxyType
from test import support
from test.support import import_helper
import _testcapi import _testcapi

View file

@ -2,7 +2,7 @@
# these are all functions _testcapi exports whose name begins with 'test_'. # these are all functions _testcapi exports whose name begins with 'test_'.
import _thread import _thread
from collections import OrderedDict, deque from collections import deque
import contextlib import contextlib
import importlib.machinery import importlib.machinery
import importlib.util import importlib.util

View file

@ -10,7 +10,7 @@ import csv
import gc import gc
import pickle import pickle
from test import support 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 itertools import permutations
from textwrap import dedent from textwrap import dedent
from collections import OrderedDict from collections import OrderedDict

View file

@ -41,7 +41,6 @@ from test.support import (TestFailed,
darwin_malloc_err_warning, is_emscripten) darwin_malloc_err_warning, is_emscripten)
from test.support.import_helper import import_fresh_module from test.support.import_helper import import_fresh_module
from test.support import threading_helper from test.support import threading_helper
from test.support import warnings_helper
import random import random
import inspect import inspect
import threading import threading

View file

@ -1,7 +1,6 @@
import collections.abc import collections.abc
import copy import copy
import pickle import pickle
import sys
import unittest import unittest
from test.support import Py_C_RECURSION_LIMIT from test.support import Py_C_RECURSION_LIMIT

View file

@ -4,7 +4,6 @@
# Lib/test/test_jit_gdb.py # Lib/test/test_jit_gdb.py
import os import os
import platform
import re import re
import subprocess import subprocess
import sys import sys

View file

@ -1,7 +1,6 @@
from test.test_importlib import util from test.test_importlib import util
import sys import sys
import unittest import unittest
from test import support
from test.support import import_helper from test.support import import_helper

View file

@ -1,5 +1,4 @@
import os.path import os.path
import unittest
from test import support from test import support
from test.support import load_package_tests from test.support import load_package_tests

View file

@ -2,7 +2,6 @@
# handler, are obscure and unhelpful. # handler, are obscure and unhelpful.
import os import os
import platform
import sys import sys
import sysconfig import sysconfig
import unittest import unittest
@ -14,7 +13,7 @@ from test.support import os_helper
from xml.parsers import expat from xml.parsers import expat
from xml.parsers.expat import errors from xml.parsers.expat import errors
from test.support import sortdict, is_emscripten, is_wasi from test.support import sortdict
class SetAttributeTest(unittest.TestCase): class SetAttributeTest(unittest.TestCase):

View file

@ -1,7 +1,6 @@
# Author: Paul Kippes <kippesp@gmail.com> # Author: Paul Kippes <kippesp@gmail.com>
import unittest import unittest
import sqlite3 as sqlite
from .util import memory_database from .util import memory_database
from .util import MemoryDatabaseMixin from .util import MemoryDatabaseMixin

View file

@ -29,7 +29,7 @@ from unittest.mock import Mock, patch
from test.support import bigmemtest, gc_collect from test.support import bigmemtest, gc_collect
from .util import cx_limit, memory_database from .util import cx_limit, memory_database
from .util import with_tracebacks, check_tracebacks from .util import with_tracebacks
def func_returntext(): def func_returntext():

View file

@ -4,7 +4,6 @@ import io
import re import re
import sqlite3 import sqlite3
import test.support import test.support
import unittest
# Helper for temporary memory databases # Helper for temporary memory databases

View file

@ -1,6 +1,5 @@
import functools import functools
import tkinter import tkinter
import unittest
class AbstractTkTest: class AbstractTkTest:

View file

@ -3,7 +3,7 @@ import unittest
import concurrent.futures import concurrent.futures
from test.support import threading_helper 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) threading_helper.requires_working_threading(module=True)

View file

@ -3,7 +3,6 @@ from test import support
from test.support import import_helper from test.support import import_helper
import binascii import binascii
import copy import copy
import os
import pickle import pickle
import random import random
import sys import sys