Skip to content

gh-120417: Remove unused imports in the stdlib #120420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/_pyrepl/historical_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


if False:
from .types import Callback, SimpleContextManager, KeySpec, CommandName
from .types import SimpleContextManager, KeySpec, CommandName


isearch_keymap: tuple[tuple[KeySpec, CommandName], ...] = tuple(
Expand Down
2 changes: 1 addition & 1 deletion Lib/_pyrepl/pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# types
if False:
from typing import Protocol, Any
from typing import Protocol
class Pager(Protocol):
def __call__(self, text: str, title: str = "") -> None:
...
Expand Down
1 change: 0 additions & 1 deletion Lib/_pyrepl/unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import select
import signal
import struct
import sys
import termios
import time
from fcntl import ioctl
Expand Down
3 changes: 0 additions & 3 deletions Lib/_pyrepl/windows_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions Lib/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import itertools
import abc
from reprlib import recursive_repr
from types import FunctionType, GenericAlias


__all__ = ['dataclass',
Expand Down Expand Up @@ -333,7 +332,7 @@ def __set_name__(self, owner, name):
# it.
func(self.default, owner, name)

__class_getitem__ = classmethod(GenericAlias)
__class_getitem__ = classmethod(types.GenericAlias)


class _DataclassParams:
Expand Down
1 change: 0 additions & 1 deletion Lib/dbm/sqlite3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import sqlite3
import sys
from pathlib import Path
from contextlib import suppress, closing
from collections.abc import MutableMapping
Expand Down
2 changes: 1 addition & 1 deletion Lib/idlelib/grep.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def grep_it(self, prog, path):


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

Expand Down
1 change: 0 additions & 1 deletion Lib/importlib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
_frozen_importlib_external = _bootstrap_external
from ._abc import Loader
import abc
import warnings


__all__ = [
Expand Down
1 change: 0 additions & 1 deletion Lib/ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import os
import sys
import stat
import genericpath
from genericpath import *

Expand Down
2 changes: 1 addition & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class or function within a module or module in a package. If the
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)


Expand Down
1 change: 0 additions & 1 deletion Lib/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Suggested usage: from stat import *
"""
import sys

# Indices for stat struct members in the tuple returned by os.stat()

Expand Down
Loading