]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-120417: Remove unused imports in the stdlib (GH-120420) (#120429)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Jun 2024 19:27:32 +0000 (21:27 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2024 19:27:32 +0000 (19:27 +0000)
gh-120417: Remove unused imports in the stdlib (GH-120420)
(cherry picked from commit 4c6d4f5cb33e48519922d635894eef356faddba2)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/_pyrepl/historical_reader.py
Lib/_pyrepl/pager.py
Lib/_pyrepl/unix_console.py
Lib/_pyrepl/windows_console.py
Lib/dataclasses.py
Lib/dbm/sqlite3.py
Lib/idlelib/grep.py
Lib/importlib/abc.py
Lib/ntpath.py
Lib/pydoc.py
Lib/stat.py

index 121de33da5052fec69f57c69deda6f29edba45f7..dd90912d1d67f840056827bf697b4844c5d0dfd9 100644 (file)
@@ -27,7 +27,7 @@ from .reader import Reader
 
 
 if False:
-    from .types import Callback, SimpleContextManager, KeySpec, CommandName
+    from .types import SimpleContextManager, KeySpec, CommandName
 
 
 isearch_keymap: tuple[tuple[KeySpec, CommandName], ...] = tuple(
index 1ac733ed3573a4b9bea458785d39ea81cbf5abb9..66dcd99111adfc2009a7f1c4f1c909727cf3254a 100644 (file)
@@ -8,7 +8,7 @@ import sys
 
 # types
 if False:
-    from typing import Protocol, Any
+    from typing import Protocol
     class Pager(Protocol):
         def __call__(self, text: str, title: str = "") -> None:
             ...
index af9290819c2c784a1c60f7da9a1e2633664bf643..c4dedd97d1e13d5f1a652111c5d01d5825bd14d3 100644 (file)
@@ -27,7 +27,6 @@ import re
 import select
 import signal
 import struct
-import sys
 import termios
 import time
 from fcntl import ioctl
index f691ca3fbb07b85509f6ffc5bbd4a810dd2b385c..9e97b1524e29a0abe20de1890b4c414d739976c5 100644 (file)
 from __future__ import annotations
 
 import io
-from multiprocessing import Value
 import os
 import sys
 import time
 import msvcrt
 
-from abc import ABC, abstractmethod
 from collections import deque
-from dataclasses import dataclass, field
 import ctypes
 from ctypes.wintypes import (
     _COORD,
index aeafbfbbe6e9c4900220c6117033e5eda5fc5f6d..74011b7e28b9f3af22e7b098b6d60fc0a077e063 100644 (file)
@@ -7,7 +7,6 @@ import keyword
 import itertools
 import abc
 from reprlib import recursive_repr
-from types import FunctionType, GenericAlias
 
 
 __all__ = ['dataclass',
@@ -333,7 +332,7 @@ class Field:
             # it.
             func(self.default, owner, name)
 
-    __class_getitem__ = classmethod(GenericAlias)
+    __class_getitem__ = classmethod(types.GenericAlias)
 
 
 class _DataclassParams:
index 74c9d9b7e2f1d86f8fc2e5345644bb5981616f76..7e0ae2a29e3a64637cfd71729f204d3d1c6dd76f 100644 (file)
@@ -1,6 +1,5 @@
 import os
 import sqlite3
-import sys
 from pathlib import Path
 from contextlib import suppress, closing
 from collections.abc import MutableMapping
index ef14349960bfa2c2bb5911c86cc17aee212a49fe..42048ff2395fe1950d11547d05f896ff61c37a61 100644 (file)
@@ -190,7 +190,7 @@ class GrepDialog(SearchDialogBase):
 
 
 def _grep_dialog(parent):  # htest #
-    from tkinter import Toplevel, Text, SEL, END
+    from tkinter import Toplevel, Text, SEL
     from tkinter.ttk import Frame, Button
     from idlelib.pyshell import PyShellFileList
 
index 37fef357fe2c0c76e818fff82b71cf9f0def317d..16b96266b51be01dccb4a765b156308dc3e8bd24 100644 (file)
@@ -13,7 +13,6 @@ except ImportError:
     _frozen_importlib_external = _bootstrap_external
 from ._abc import Loader
 import abc
-import warnings
 
 from .resources import abc as _resources_abc
 
index 83e2d3b865757c8c50be435bcab63def7019fe60..1b1873f08b608bfcfd142b336e7b4fd000c9b76e 100644 (file)
@@ -19,7 +19,6 @@ devnull = 'nul'
 
 import os
 import sys
-import stat
 import genericpath
 from genericpath import *
 
index cd890a7e29954830849c7b845db7d8022e05b250..085f8edbee06df36576eea5ca7e40d645ff018d7 100755 (executable)
@@ -76,7 +76,7 @@ from collections import deque
 from reprlib import Repr
 from traceback import format_exception_only
 
-from _pyrepl.pager import (get_pager, plain, escape_less, pipe_pager,
+from _pyrepl.pager import (get_pager, plain, pipe_pager,
                            plain_pager, tempfile_pager, tty_pager)
 
 
index 9167ab185944fba5770f4d5b2df245640b811459..1b4ed1ebc940ef26c20e8a806cbca4aed6fa2bb4 100644 (file)
@@ -2,7 +2,6 @@
 
 Suggested usage: from stat import *
 """
-import sys
 
 # Indices for stat struct members in the tuple returned by os.stat()