mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Upgrade to isort 5 (#4323)
This now also reformats imports not at the top of files.
This commit is contained in:
@@ -89,13 +89,10 @@ else:
|
||||
from asyncio.events import SendfileNotAvailableError as SendfileNotAvailableError
|
||||
from asyncio.futures import (
|
||||
CancelledError as CancelledError,
|
||||
TimeoutError as TimeoutError,
|
||||
InvalidStateError as InvalidStateError,
|
||||
TimeoutError as TimeoutError,
|
||||
)
|
||||
from asyncio.streams import (
|
||||
IncompleteReadError as IncompleteReadError,
|
||||
LimitOverrunError as LimitOverrunError,
|
||||
)
|
||||
from asyncio.streams import IncompleteReadError as IncompleteReadError, LimitOverrunError as LimitOverrunError
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from asyncio.protocols import BufferedProtocol as BufferedProtocol
|
||||
@@ -104,11 +101,7 @@ if sys.version_info >= (3, 7):
|
||||
from asyncio.runners import run as run
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from asyncio.tasks import (
|
||||
all_tasks as all_tasks,
|
||||
create_task as create_task,
|
||||
current_task as current_task,
|
||||
)
|
||||
from asyncio.tasks import all_tasks as all_tasks, create_task as create_task, current_task as current_task
|
||||
if sys.version_info >= (3, 9):
|
||||
from asyncio.threads import to_thread as to_thread
|
||||
|
||||
@@ -117,10 +110,8 @@ if sys.platform == "win32":
|
||||
from asyncio.windows_events import *
|
||||
|
||||
if sys.platform != "win32":
|
||||
from asyncio.streams import (
|
||||
open_unix_connection as open_unix_connection,
|
||||
start_unix_server as start_unix_server,
|
||||
)
|
||||
from asyncio.streams import open_unix_connection as open_unix_connection, start_unix_server as start_unix_server
|
||||
|
||||
from .unix_events import (
|
||||
AbstractChildWatcher as AbstractChildWatcher,
|
||||
FastChildWatcher as FastChildWatcher,
|
||||
|
||||
@@ -5,8 +5,7 @@ from typing import Any, Awaitable, Callable, Generator, Iterable, List, Optional
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
from concurrent.futures import CancelledError as CancelledError
|
||||
from concurrent.futures import TimeoutError as TimeoutError
|
||||
from concurrent.futures import CancelledError as CancelledError, TimeoutError as TimeoutError
|
||||
class InvalidStateError(Error): ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -41,10 +41,7 @@ from typing import (
|
||||
from . import abc
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from typing import (
|
||||
Collection as Collection,
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
)
|
||||
from typing import AsyncGenerator as AsyncGenerator, Collection as Collection
|
||||
|
||||
_S = TypeVar("_S")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -29,8 +29,4 @@ from . import (
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from . import (
|
||||
Collection as Collection,
|
||||
Reversible as Reversible,
|
||||
AsyncGenerator as AsyncGenerator,
|
||||
)
|
||||
from . import AsyncGenerator as AsyncGenerator, Collection as Collection, Reversible as Reversible
|
||||
|
||||
@@ -3,10 +3,9 @@ import sys
|
||||
# This is a >=3.7 module, so we conditionally include its source.
|
||||
if sys.version_info >= (3, 7):
|
||||
import os
|
||||
|
||||
from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import ContextManager, Iterator, Union, BinaryIO, TextIO
|
||||
from typing import BinaryIO, ContextManager, Iterator, TextIO, Union
|
||||
|
||||
Package = Union[str, ModuleType]
|
||||
Resource = Union[str, os.PathLike]
|
||||
|
||||
@@ -25,7 +25,7 @@ from typing import (
|
||||
from .context import BaseContext
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from .shared_memory import ShareableList, SharedMemory, _SLT
|
||||
from .shared_memory import _SLT, ShareableList, SharedMemory
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_KT = TypeVar("_KT")
|
||||
|
||||
@@ -10,9 +10,9 @@ from typing import Any, AnyStr, Callable, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
# ----- re variables and constants -----
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import Pattern as Pattern, Match as Match
|
||||
from typing import Match as Match, Pattern as Pattern
|
||||
else:
|
||||
from typing import Pattern, Match
|
||||
from typing import Match, Pattern
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
import enum
|
||||
|
||||
Reference in New Issue
Block a user