From 256b3ce8aba6080f9a1c90c8c264e93e49e754cd Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 16:59:32 +0200 Subject: [PATCH] Remove a bunch of unused imports (#3323) --- stdlib/2/os/path.pyi | 5 +---- stdlib/2/os2emxpath.pyi | 5 +---- stdlib/2and3/macpath.pyi | 5 +---- stdlib/2and3/ntpath.pyi | 5 +---- stdlib/2and3/posixpath.pyi | 5 +---- stdlib/3.7/contextvars.pyi | 2 +- stdlib/3/_imp.pyi | 1 - stdlib/3/_importlib_modulespec.pyi | 1 - stdlib/3/_operator.pyi | 1 - stdlib/3/asyncio/coroutines.pyi | 2 +- stdlib/3/asyncio/futures.pyi | 2 +- stdlib/3/asyncio/locks.pyi | 2 +- stdlib/3/asyncio/queues.pyi | 2 -- stdlib/3/asyncio/tasks.pyi | 6 +++--- stdlib/3/asyncio/transports.pyi | 2 +- stdlib/3/email/__init__.pyi | 3 +-- stdlib/3/email/feedparser.pyi | 1 - stdlib/3/email/message.pyi | 1 - stdlib/3/email/parser.pyi | 2 +- stdlib/3/email/policy.pyi | 1 - stdlib/3/encodings/__init__.pyi | 5 +---- stdlib/3/functools.pyi | 1 - stdlib/3/heapq.pyi | 1 - stdlib/3/html/parser.pyi | 1 - stdlib/3/http/cookies.pyi | 2 +- stdlib/3/importlib/__init__.pyi | 1 - stdlib/3/importlib/machinery.pyi | 3 +-- stdlib/3/io.pyi | 1 - stdlib/3/json/decoder.pyi | 1 - stdlib/3/msvcrt.pyi | 2 -- stdlib/3/multiprocessing/__init__.pyi | 5 +---- stdlib/3/multiprocessing/context.pyi | 5 +---- stdlib/3/multiprocessing/dummy/__init__.pyi | 6 +----- stdlib/3/multiprocessing/dummy/connection.pyi | 2 +- stdlib/3/multiprocessing/pool.pyi | 6 +----- stdlib/3/os/__init__.pyi | 2 +- stdlib/3/os/path.pyi | 5 +---- stdlib/3/posix.pyi | 2 +- stdlib/3/smtplib.pyi | 5 +---- stdlib/3/stat.pyi | 1 - stdlib/3/string.pyi | 2 +- stdlib/3/subprocess.pyi | 6 +----- stdlib/3/unittest/loader.pyi | 1 - stdlib/3/unittest/result.pyi | 2 +- stdlib/3/unittest/runner.pyi | 1 - stdlib/3/urllib/parse.pyi | 1 - third_party/3/contextvars.pyi | 2 +- 47 files changed, 31 insertions(+), 95 deletions(-) diff --git a/stdlib/2/os/path.pyi b/stdlib/2/os/path.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/2/os/path.pyi +++ b/stdlib/2/os/path.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/2/os2emxpath.pyi b/stdlib/2/os2emxpath.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/2/os2emxpath.pyi +++ b/stdlib/2/os2emxpath.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/2and3/macpath.pyi b/stdlib/2and3/macpath.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/2and3/macpath.pyi +++ b/stdlib/2and3/macpath.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/2and3/ntpath.pyi b/stdlib/2and3/ntpath.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/2and3/ntpath.pyi +++ b/stdlib/2and3/ntpath.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/2and3/posixpath.pyi b/stdlib/2and3/posixpath.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/2and3/posixpath.pyi +++ b/stdlib/2and3/posixpath.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/3.7/contextvars.pyi b/stdlib/3.7/contextvars.pyi index ab2ae9e5fabf..a90c2a8b5f65 100644 --- a/stdlib/3.7/contextvars.pyi +++ b/stdlib/3.7/contextvars.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar _T = TypeVar('_T') diff --git a/stdlib/3/_imp.pyi b/stdlib/3/_imp.pyi index 1992e3bda119..f3c3945baba9 100644 --- a/stdlib/3/_imp.pyi +++ b/stdlib/3/_imp.pyi @@ -1,6 +1,5 @@ # Stubs for _imp (Python 3.6) -import sys import types from typing import Any, List diff --git a/stdlib/3/_importlib_modulespec.pyi b/stdlib/3/_importlib_modulespec.pyi index 51cb48983dd3..026dab8d01a3 100644 --- a/stdlib/3/_importlib_modulespec.pyi +++ b/stdlib/3/_importlib_modulespec.pyi @@ -8,7 +8,6 @@ # _Loader is the PEP-451-defined interface for a loader type/object. from abc import ABCMeta -import sys from typing import Any, Dict, List, Optional, Protocol class _Loader(Protocol): diff --git a/stdlib/3/_operator.pyi b/stdlib/3/_operator.pyi index bd162ab9f207..e968fb7daa1e 100644 --- a/stdlib/3/_operator.pyi +++ b/stdlib/3/_operator.pyi @@ -1,6 +1,5 @@ # Stubs for _operator (Python 3.5) -import sys from typing import AnyStr # In reality the import is the other way around, but this way we can keep the operator stub in 2and3 diff --git a/stdlib/3/asyncio/coroutines.pyi b/stdlib/3/asyncio/coroutines.pyi index 981ccd5a0018..480093273e8d 100644 --- a/stdlib/3/asyncio/coroutines.pyi +++ b/stdlib/3/asyncio/coroutines.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Generator, List, TypeVar +from typing import Any, Callable, List, TypeVar __all__: List[str] diff --git a/stdlib/3/asyncio/futures.pyi b/stdlib/3/asyncio/futures.pyi index 37bd02c30fcd..4ebaa339ed92 100644 --- a/stdlib/3/asyncio/futures.pyi +++ b/stdlib/3/asyncio/futures.pyi @@ -1,5 +1,5 @@ import sys -from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple +from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple from .events import AbstractEventLoop from concurrent.futures import ( CancelledError as CancelledError, diff --git a/stdlib/3/asyncio/locks.pyi b/stdlib/3/asyncio/locks.pyi index 56b8a672718a..3e30cc528533 100644 --- a/stdlib/3/asyncio/locks.pyi +++ b/stdlib/3/asyncio/locks.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Generator, Iterable, Iterator, List, Type, TypeVar, Union, Optional, Awaitable +from typing import Any, Callable, Generator, List, Type, TypeVar, Union, Optional, Awaitable from .coroutines import coroutine from .events import AbstractEventLoop diff --git a/stdlib/3/asyncio/queues.pyi b/stdlib/3/asyncio/queues.pyi index 243a74d54201..cae88d10cea1 100644 --- a/stdlib/3/asyncio/queues.pyi +++ b/stdlib/3/asyncio/queues.pyi @@ -1,7 +1,5 @@ -import sys from asyncio.events import AbstractEventLoop from .coroutines import coroutine -from .futures import Future from typing import Any, Generator, Generic, List, TypeVar, Optional __all__: List[str] diff --git a/stdlib/3/asyncio/tasks.pyi b/stdlib/3/asyncio/tasks.pyi index 05b590eb0430..d848abb39e53 100644 --- a/stdlib/3/asyncio/tasks.pyi +++ b/stdlib/3/asyncio/tasks.pyi @@ -1,8 +1,8 @@ import concurrent.futures import sys -from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, - Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator, - Optional) +from typing import ( + Any, TypeVar, Set, List, TextIO, Union, Tuple, Generic, Generator, Iterable, Awaitable, overload, Iterator, Optional, +) from types import FrameType from .events import AbstractEventLoop from .futures import Future diff --git a/stdlib/3/asyncio/transports.pyi b/stdlib/3/asyncio/transports.pyi index ea6ab4adb67b..b2ee08a9c42f 100644 --- a/stdlib/3/asyncio/transports.pyi +++ b/stdlib/3/asyncio/transports.pyi @@ -1,5 +1,5 @@ import sys -from typing import Dict, Any, TypeVar, Mapping, List, Optional, Tuple +from typing import Any, Mapping, List, Optional, Tuple from asyncio.protocols import BaseProtocol __all__: List[str] diff --git a/stdlib/3/email/__init__.pyi b/stdlib/3/email/__init__.pyi index ec7c25bd4b69..a69f188d4f7b 100644 --- a/stdlib/3/email/__init__.pyi +++ b/stdlib/3/email/__init__.pyi @@ -1,7 +1,6 @@ # Stubs for email (Python 3.4) -from typing import Callable, Optional, IO -import sys +from typing import Callable, IO from email.message import Message from email.policy import Policy diff --git a/stdlib/3/email/feedparser.pyi b/stdlib/3/email/feedparser.pyi index 48d940b3987d..facfd438c500 100644 --- a/stdlib/3/email/feedparser.pyi +++ b/stdlib/3/email/feedparser.pyi @@ -1,7 +1,6 @@ # Stubs for email.feedparser (Python 3.4) from typing import Callable -import sys from email.message import Message from email.policy import Policy diff --git a/stdlib/3/email/message.pyi b/stdlib/3/email/message.pyi index 88aef3efef06..8cd037eabc35 100644 --- a/stdlib/3/email/message.pyi +++ b/stdlib/3/email/message.pyi @@ -3,7 +3,6 @@ from typing import ( List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any ) -import sys from email.charset import Charset from email.errors import MessageDefect from email.header import Header diff --git a/stdlib/3/email/parser.pyi b/stdlib/3/email/parser.pyi index 180e382ee8e4..89ca2774b34a 100644 --- a/stdlib/3/email/parser.pyi +++ b/stdlib/3/email/parser.pyi @@ -3,7 +3,7 @@ import email.feedparser from email.message import Message from email.policy import Policy -from typing import BinaryIO, Callable, Optional, TextIO +from typing import BinaryIO, Callable, TextIO FeedParser = email.feedparser.FeedParser BytesFeedParser = email.feedparser.BytesFeedParser diff --git a/stdlib/3/email/policy.pyi b/stdlib/3/email/policy.pyi index 581cf58913f5..5f3b8977af9d 100644 --- a/stdlib/3/email/policy.pyi +++ b/stdlib/3/email/policy.pyi @@ -2,7 +2,6 @@ from abc import abstractmethod from typing import Any, List, Optional, Tuple, Union, Callable -import sys from email.message import Message from email.errors import MessageDefect from email.header import Header diff --git a/stdlib/3/encodings/__init__.pyi b/stdlib/3/encodings/__init__.pyi index 2ae6c0a9351d..0c050530725a 100644 --- a/stdlib/3/encodings/__init__.pyi +++ b/stdlib/3/encodings/__init__.pyi @@ -1,6 +1,3 @@ import codecs -import typing - -def search_function(encoding: str) -> codecs.CodecInfo: - ... +def search_function(encoding: str) -> codecs.CodecInfo: ... diff --git a/stdlib/3/functools.pyi b/stdlib/3/functools.pyi index ce89e7173154..f1e43a5bb2f8 100644 --- a/stdlib/3/functools.pyi +++ b/stdlib/3/functools.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload _AnyCallable = Callable[..., Any] diff --git a/stdlib/3/heapq.pyi b/stdlib/3/heapq.pyi index 0764da5183a5..8f703c58105c 100644 --- a/stdlib/3/heapq.pyi +++ b/stdlib/3/heapq.pyi @@ -2,7 +2,6 @@ # Based on http://docs.python.org/3.2/library/heapq.html -import sys from typing import TypeVar, List, Iterable, Any, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/3/html/parser.pyi b/stdlib/3/html/parser.pyi index 55b99ea3407f..874b85057bc5 100644 --- a/stdlib/3/html/parser.pyi +++ b/stdlib/3/html/parser.pyi @@ -1,6 +1,5 @@ from typing import List, Optional, Tuple from _markupbase import ParserBase -import sys class HTMLParser(ParserBase): def __init__(self, *, convert_charrefs: bool = ...) -> None: ... diff --git a/stdlib/3/http/cookies.pyi b/stdlib/3/http/cookies.pyi index dfd6df88cba1..886d3c71adb9 100644 --- a/stdlib/3/http/cookies.pyi +++ b/stdlib/3/http/cookies.pyi @@ -1,6 +1,6 @@ # Stubs for http.cookies (Python 3.5) -from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union, Any +from typing import Generic, Dict, List, Mapping, Optional, TypeVar, Union, Any _DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]] _T = TypeVar('_T') diff --git a/stdlib/3/importlib/__init__.pyi b/stdlib/3/importlib/__init__.pyi index d46f7e19d555..e44f424164af 100644 --- a/stdlib/3/importlib/__init__.pyi +++ b/stdlib/3/importlib/__init__.pyi @@ -1,5 +1,4 @@ from importlib.abc import Loader -import sys import types from typing import Any, Mapping, Optional, Sequence diff --git a/stdlib/3/importlib/machinery.pyi b/stdlib/3/importlib/machinery.pyi index 036a91fe487e..746c5026c759 100644 --- a/stdlib/3/importlib/machinery.pyi +++ b/stdlib/3/importlib/machinery.pyi @@ -1,7 +1,6 @@ import importlib.abc -import sys import types -from typing import Any, Callable, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, List, Optional, Sequence, Tuple # ModuleSpec is exported from this module, but for circular import # reasons exists in its own stub file (with Loader and ModuleType). diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index 351d5be86d2c..d3cc6948b499 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -4,7 +4,6 @@ from typing import ( import builtins import codecs from mmap import mmap -import sys from types import TracebackType from typing import TypeVar diff --git a/stdlib/3/json/decoder.pyi b/stdlib/3/json/decoder.pyi index 1acb84af8b0e..d57a6a9fc8da 100644 --- a/stdlib/3/json/decoder.pyi +++ b/stdlib/3/json/decoder.pyi @@ -1,4 +1,3 @@ -import sys from typing import Any, Callable, Dict, List, Optional, Tuple class JSONDecodeError(ValueError): diff --git a/stdlib/3/msvcrt.pyi b/stdlib/3/msvcrt.pyi index bcab64cd9a0a..6688c37cd80e 100644 --- a/stdlib/3/msvcrt.pyi +++ b/stdlib/3/msvcrt.pyi @@ -2,7 +2,5 @@ # NOTE: These are incomplete! -from typing import overload, BinaryIO, TextIO - def get_osfhandle(file: int) -> int: ... def open_osfhandle(handle: int, flags: int) -> int: ... diff --git a/stdlib/3/multiprocessing/__init__.pyi b/stdlib/3/multiprocessing/__init__.pyi index e2513f3bd75e..f99720f46ed1 100644 --- a/stdlib/3/multiprocessing/__init__.pyi +++ b/stdlib/3/multiprocessing/__init__.pyi @@ -1,9 +1,6 @@ # Stubs for multiprocessing -from typing import ( - Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List, - Union, Sequence, Tuple, Type, overload -) +from typing import Any, Callable, Iterable, Mapping, Optional, List, Union, Sequence, Tuple, Type, overload from ctypes import _CData from logging import Logger diff --git a/stdlib/3/multiprocessing/context.pyi b/stdlib/3/multiprocessing/context.pyi index 2cdeb07d14cc..8486626ca253 100644 --- a/stdlib/3/multiprocessing/context.pyi +++ b/stdlib/3/multiprocessing/context.pyi @@ -5,10 +5,7 @@ import multiprocessing from multiprocessing import synchronize from multiprocessing import queues import sys -from typing import ( - Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type, - Union, -) +from typing import Any, Callable, Iterable, Optional, List, Mapping, Sequence, Type, Union _LockLike = Union[synchronize.Lock, synchronize.RLock] diff --git a/stdlib/3/multiprocessing/dummy/__init__.pyi b/stdlib/3/multiprocessing/dummy/__init__.pyi index 2a995cda633a..0572356e52ba 100644 --- a/stdlib/3/multiprocessing/dummy/__init__.pyi +++ b/stdlib/3/multiprocessing/dummy/__init__.pyi @@ -1,13 +1,9 @@ -from typing import Any, Optional, List, Type +from typing import Any, Optional, List import array -import sys import threading import weakref -from .connection import Pipe -from threading import Lock, RLock, Semaphore, BoundedSemaphore -from threading import Event, Condition, Barrier from queue import Queue JoinableQueue = Queue diff --git a/stdlib/3/multiprocessing/dummy/connection.pyi b/stdlib/3/multiprocessing/dummy/connection.pyi index 537750e19f3b..d465a5b4f434 100644 --- a/stdlib/3/multiprocessing/dummy/connection.pyi +++ b/stdlib/3/multiprocessing/dummy/connection.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, Optional, Tuple, Type, TypeVar +from typing import Any, List, Optional, Tuple, TypeVar from queue import Queue diff --git a/stdlib/3/multiprocessing/pool.pyi b/stdlib/3/multiprocessing/pool.pyi index 3782a3f1dc4b..479c4f21834d 100644 --- a/stdlib/3/multiprocessing/pool.pyi +++ b/stdlib/3/multiprocessing/pool.pyi @@ -1,8 +1,4 @@ -from typing import ( - Any, Callable, ContextManager, Iterable, Mapping, Optional, List, - Type, TypeVar, Generic, Iterator -) -from types import TracebackType +from typing import Any, Callable, ContextManager, Iterable, Mapping, Optional, List, TypeVar, Generic, Iterator _PT = TypeVar('_PT', bound=Pool) _S = TypeVar('_S') diff --git a/stdlib/3/os/__init__.pyi b/stdlib/3/os/__init__.pyi index 085000a0922f..e94c36efe08b 100644 --- a/stdlib/3/os/__init__.pyi +++ b/stdlib/3/os/__init__.pyi @@ -5,7 +5,7 @@ from io import TextIOWrapper as _TextIOWrapper from posix import listdir as listdir, times_result import sys from typing import ( - Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr, + Mapping, MutableMapping, Dict, List, Any, Tuple, Iterable, Iterator, NoReturn, overload, Union, AnyStr, Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager ) diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index c0bf57658ed7..42409c0e8721 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -4,10 +4,7 @@ import os import sys -from typing import ( - overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO, - TypeVar, Union, Text, Callable, Optional -) +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional _T = TypeVar('_T') diff --git a/stdlib/3/posix.pyi b/stdlib/3/posix.pyi index 83537cfbc650..fe9782354c94 100644 --- a/stdlib/3/posix.pyi +++ b/stdlib/3/posix.pyi @@ -3,7 +3,7 @@ # NOTE: These are incomplete! import sys -from typing import List, NamedTuple, Optional, overload, Tuple +from typing import List, NamedTuple, Optional, overload from os import stat_result as stat_result diff --git a/stdlib/3/smtplib.pyi b/stdlib/3/smtplib.pyi index d13439b385d5..803b010bd7a0 100644 --- a/stdlib/3/smtplib.pyi +++ b/stdlib/3/smtplib.pyi @@ -2,10 +2,7 @@ from email.message import Message as _Message from socket import socket from ssl import SSLContext from types import TracebackType -from typing import ( - Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union, - Pattern, Type, Callable, Protocol, overload) -import sys +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, Pattern, Type, Protocol, overload _Reply = Tuple[int, bytes] _SendErrs = Dict[str, _Reply] diff --git a/stdlib/3/stat.pyi b/stdlib/3/stat.pyi index c45a06863e2f..74bc444154c1 100644 --- a/stdlib/3/stat.pyi +++ b/stdlib/3/stat.pyi @@ -3,7 +3,6 @@ # Based on http://docs.python.org/3.2/library/stat.html import sys -import typing def S_ISDIR(mode: int) -> bool: ... def S_ISCHR(mode: int) -> bool: ... diff --git a/stdlib/3/string.pyi b/stdlib/3/string.pyi index 92fc03611db6..c5b1ff9f8c22 100644 --- a/stdlib/3/string.pyi +++ b/stdlib/3/string.pyi @@ -2,7 +2,7 @@ # Based on http://docs.python.org/3.2/library/string.html -from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable +from typing import Mapping, Sequence, Any, Optional, Union, Tuple, Iterable ascii_letters: str ascii_lowercase: str diff --git a/stdlib/3/subprocess.pyi b/stdlib/3/subprocess.pyi index 8bc2e807e571..e3a97bd91f6f 100644 --- a/stdlib/3/subprocess.pyi +++ b/stdlib/3/subprocess.pyi @@ -2,11 +2,7 @@ # Based on http://docs.python.org/3.6/library/subprocess.html import sys -from typing import ( - Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text, - Generic, TypeVar, AnyStr, - overload, -) +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload from types import TracebackType if sys.version_info >= (3, 8): diff --git a/stdlib/3/unittest/loader.pyi b/stdlib/3/unittest/loader.pyi index d32c7132bdb1..2371778f9ec1 100644 --- a/stdlib/3/unittest/loader.pyi +++ b/stdlib/3/unittest/loader.pyi @@ -1,4 +1,3 @@ -import sys import unittest.case import unittest.suite import unittest.result diff --git a/stdlib/3/unittest/result.pyi b/stdlib/3/unittest/result.pyi index cb85399a5548..6ce685a290c8 100644 --- a/stdlib/3/unittest/result.pyi +++ b/stdlib/3/unittest/result.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, Optional, Tuple, Type +from typing import List, Optional, Tuple, Type from types import TracebackType import unittest.case diff --git a/stdlib/3/unittest/runner.pyi b/stdlib/3/unittest/runner.pyi index 4c84d8b06fff..95199b2cd518 100644 --- a/stdlib/3/unittest/runner.pyi +++ b/stdlib/3/unittest/runner.pyi @@ -1,5 +1,4 @@ from typing import Callable, Optional, TextIO, Tuple, Type, Union -import sys import unittest.case import unittest.result import unittest.suite diff --git a/stdlib/3/urllib/parse.pyi b/stdlib/3/urllib/parse.pyi index 952d3cf9e346..7252b227663a 100644 --- a/stdlib/3/urllib/parse.pyi +++ b/stdlib/3/urllib/parse.pyi @@ -1,6 +1,5 @@ # Stubs for urllib.parse from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional -import sys _Str = Union[bytes, str] diff --git a/third_party/3/contextvars.pyi b/third_party/3/contextvars.pyi index ab2ae9e5fabf..a90c2a8b5f65 100644 --- a/third_party/3/contextvars.pyi +++ b/third_party/3/contextvars.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar _T = TypeVar('_T')