Use imports instead of TypeAliases in a couple places (#7634)

Fixes #7632
This commit is contained in:
Alex Waygood
2022-04-16 09:38:59 +01:00
committed by GitHub
parent 740193a8fc
commit 66bea8ca48
2 changed files with 6 additions and 12 deletions

View File

@@ -2,10 +2,11 @@ import subprocess
import sys
import time
from _typeshed import Self
from builtins import list as _list # conflicts with a method named "list"
from socket import socket as _socket
from ssl import SSLContext, SSLSocket
from types import TracebackType
from typing import IO, Any, Callable, Pattern, TypeVar
from typing import IO, Any, Callable, Pattern
from typing_extensions import Literal, TypeAlias
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]
@@ -16,9 +17,6 @@ _CommandResults: TypeAlias = tuple[str, list[Any]]
_AnyResponseData: TypeAlias = list[None] | list[bytes | tuple[bytes, bytes]]
_T = TypeVar("_T")
_list: TypeAlias = list[_T] # conflicts with a method named "list"
class IMAP4:
error: type[Exception]
abort: type[Exception]