From 259dd71c32a42708a2800c72898e2664a33fda9c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 13 Jun 2022 16:28:41 +0200 Subject: [PATCH] gh-84623: Remove unused imports in stdlib (#93773) --- Lib/asyncio/base_futures.py | 1 - Lib/asyncio/coroutines.py | 1 - Lib/asyncio/locks.py | 1 - Lib/asyncio/runners.py | 1 - Lib/asyncio/streams.py | 1 - Lib/distutils/sysconfig.py | 1 - Lib/idlelib/configdialog.py | 2 +- Lib/idlelib/util.py | 1 - Lib/threading.py | 2 +- Lib/tkinter/commondialog.py | 2 +- Lib/urllib/parse.py | 1 - Lib/urllib/request.py | 1 - 12 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Lib/asyncio/base_futures.py b/Lib/asyncio/base_futures.py index cd811a788cb..7987963bd99 100644 --- a/Lib/asyncio/base_futures.py +++ b/Lib/asyncio/base_futures.py @@ -1,7 +1,6 @@ __all__ = () import reprlib -from _thread import get_ident from . import format_helpers diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index 0e4b489f30f..7fda0e449d5 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -4,7 +4,6 @@ import inspect import os import sys -import traceback import types diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index e71130274dd..42177f1c079 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -8,7 +8,6 @@ from . import exceptions from . import mixins -from . import tasks class _ContextManagerMixin: async def __aenter__(self): diff --git a/Lib/asyncio/runners.py b/Lib/asyncio/runners.py index 065691bed99..f524c3b8e42 100644 --- a/Lib/asyncio/runners.py +++ b/Lib/asyncio/runners.py @@ -5,7 +5,6 @@ import functools import threading import signal -import sys from . import coroutines from . import events from . import exceptions diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index a568c4e4b29..9a169035de8 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -4,7 +4,6 @@ import socket import sys -import warnings import weakref if hasattr(socket, 'AF_UNIX'): diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 3414a761e76..04187751205 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -9,7 +9,6 @@ Email: """ -import _imp import os import re import sys diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index d5748a64a79..57eaffeef39 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -11,7 +11,7 @@ """ import re -from tkinter import (Toplevel, Listbox, Scale, Canvas, +from tkinter import (Toplevel, Listbox, Canvas, StringVar, BooleanVar, IntVar, TRUE, FALSE, TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE, NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW, diff --git a/Lib/idlelib/util.py b/Lib/idlelib/util.py index 5480219786b..ede670a4db5 100644 --- a/Lib/idlelib/util.py +++ b/Lib/idlelib/util.py @@ -12,7 +12,6 @@ * std streams (pyshell, run), * warning stuff (pyshell, run). """ -from os import path # .pyw is for Windows; .pyi is for stub files. py_extensions = ('.py', '.pyw', '.pyi') # Order needed for open/save dialogs. diff --git a/Lib/threading.py b/Lib/threading.py index a3df587f106..e32ad1418d9 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -7,7 +7,7 @@ from time import monotonic as _time from _weakrefset import WeakSet -from itertools import islice as _islice, count as _count +from itertools import count as _count try: from _collections import deque as _deque except ImportError: diff --git a/Lib/tkinter/commondialog.py b/Lib/tkinter/commondialog.py index e595c99defb..86f5387e001 100644 --- a/Lib/tkinter/commondialog.py +++ b/Lib/tkinter/commondialog.py @@ -10,7 +10,7 @@ __all__ = ["Dialog"] -from tkinter import Frame, _get_temp_root, _destroy_temp_root +from tkinter import _get_temp_root, _destroy_temp_root class Dialog: diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index d70a6943f0a..fd6d9f44c62 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -30,7 +30,6 @@ from collections import namedtuple import functools import re -import sys import types import warnings diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 6d580a434a7..c352fb25ae2 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -88,7 +88,6 @@ import http.client import io import os -import posixpath import re import socket import string