diff options
author | Victor Stinner <vstinner@python.org> | 2024-06-12 18:56:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 18:56:42 (GMT) |
commit | 4c6d4f5cb33e48519922d635894eef356faddba2 (patch) | |
tree | 71f5b59450bb73eeddbe89348ecac15c3dc89258 /Lib | |
parent | 4b5d3e0e721a952f4ac9d17bee331e6dfe543dcd (diff) | |
download | cpython-4c6d4f5cb33e48519922d635894eef356faddba2.zip cpython-4c6d4f5cb33e48519922d635894eef356faddba2.tar.gz cpython-4c6d4f5cb33e48519922d635894eef356faddba2.tar.bz2 |
gh-120417: Remove unused imports in the stdlib (#120420)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/_pyrepl/historical_reader.py | 2 | ||||
-rw-r--r-- | Lib/_pyrepl/pager.py | 2 | ||||
-rw-r--r-- | Lib/_pyrepl/unix_console.py | 1 | ||||
-rw-r--r-- | Lib/_pyrepl/windows_console.py | 3 | ||||
-rw-r--r-- | Lib/dataclasses.py | 3 | ||||
-rw-r--r-- | Lib/dbm/sqlite3.py | 1 | ||||
-rw-r--r-- | Lib/idlelib/grep.py | 2 | ||||
-rw-r--r-- | Lib/importlib/abc.py | 1 | ||||
-rw-r--r-- | Lib/ntpath.py | 1 | ||||
-rw-r--r-- | Lib/pydoc.py | 2 | ||||
-rw-r--r-- | Lib/stat.py | 1 |
11 files changed, 5 insertions, 14 deletions
diff --git a/Lib/_pyrepl/historical_reader.py b/Lib/_pyrepl/historical_reader.py index 121de33..dd90912 100644 --- a/Lib/_pyrepl/historical_reader.py +++ b/Lib/_pyrepl/historical_reader.py @@ -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( diff --git a/Lib/_pyrepl/pager.py b/Lib/_pyrepl/pager.py index 1ac733e..66dcd99 100644 --- a/Lib/_pyrepl/pager.py +++ b/Lib/_pyrepl/pager.py @@ -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: ... diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py index af92908..c4dedd9 100644 --- a/Lib/_pyrepl/unix_console.py +++ b/Lib/_pyrepl/unix_console.py @@ -27,7 +27,6 @@ import re import select import signal import struct -import sys import termios import time from fcntl import ioctl diff --git a/Lib/_pyrepl/windows_console.py b/Lib/_pyrepl/windows_console.py index f691ca3..9e97b15 100644 --- a/Lib/_pyrepl/windows_console.py +++ b/Lib/_pyrepl/windows_console.py @@ -20,15 +20,12 @@ 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, diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index aeafbfb..74011b7 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -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: diff --git a/Lib/dbm/sqlite3.py b/Lib/dbm/sqlite3.py index 74c9d9b..7e0ae2a2 100644 --- a/Lib/dbm/sqlite3.py +++ b/Lib/dbm/sqlite3.py @@ -1,6 +1,5 @@ import os import sqlite3 -import sys from pathlib import Path from contextlib import suppress, closing from collections.abc import MutableMapping diff --git a/Lib/idlelib/grep.py b/Lib/idlelib/grep.py index ef14349..42048ff 100644 --- a/Lib/idlelib/grep.py +++ b/Lib/idlelib/grep.py @@ -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 diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index b6b2c79..eea6b38 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -13,7 +13,6 @@ except ImportError: _frozen_importlib_external = _bootstrap_external from ._abc import Loader import abc -import warnings __all__ = [ diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 83e2d3b..1b1873f 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -19,7 +19,6 @@ devnull = 'nul' import os import sys -import stat import genericpath from genericpath import * diff --git a/Lib/pydoc.py b/Lib/pydoc.py index d7579c1..278e484 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -75,7 +75,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) diff --git a/Lib/stat.py b/Lib/stat.py index 9167ab1..1b4ed1e 100644 --- a/Lib/stat.py +++ b/Lib/stat.py @@ -2,7 +2,6 @@ Suggested usage: from stat import * """ -import sys # Indices for stat struct members in the tuple returned by os.stat() |