Skip to content

Commit

Permalink
[3.13] pythongh-120417: Remove unused imports in the stdlib (pythonGH…
Browse files Browse the repository at this point in the history
…-120420) (python#120429)

pythongh-120417: Remove unused imports in the stdlib (pythonGH-120420)
(cherry picked from commit 4c6d4f5)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner authored Jun 12, 2024
1 parent 7c6b342 commit 5172462
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 14 deletions.
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

from .resources import abc as _resources_abc

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 @@ -76,7 +76,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

0 comments on commit 5172462

Please sign in to comment.