Replace 'Text' with 'str' in py3 stdlib (#5466)

This commit is contained in:
Sebastian Rittau
2021-05-16 16:10:48 +02:00
committed by GitHub
parent dbe77b6ae9
commit 6a9c89e928
49 changed files with 328 additions and 349 deletions

View File

@@ -4,7 +4,7 @@ import time
from socket import socket as _socket
from ssl import SSLContext, SSLSocket
from types import TracebackType
from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Text, Tuple, Type, Union
from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Tuple, Type, Union
from typing_extensions import Literal
# TODO: Commands should use their actual return types, not this type alias.
@@ -17,17 +17,17 @@ class IMAP4:
error: Type[Exception] = ...
abort: Type[Exception] = ...
readonly: Type[Exception] = ...
mustquote: Pattern[Text] = ...
mustquote: Pattern[str] = ...
debug: int = ...
state: str = ...
literal: Optional[Text] = ...
literal: Optional[str] = ...
tagged_commands: Dict[bytes, Optional[List[bytes]]]
untagged_responses: Dict[str, List[Union[bytes, Tuple[bytes, bytes]]]]
continuation_response: str = ...
is_readonly: bool = ...
tagnum: int = ...
tagpre: str = ...
tagre: Pattern[Text] = ...
tagre: Pattern[str] = ...
welcome: bytes = ...
capabilities: Tuple[str] = ...
PROTOCOL_VERSION: str = ...
@@ -41,7 +41,7 @@ class IMAP4:
host: str = ...
port: int = ...
sock: _socket = ...
file: Union[IO[Text], IO[bytes]] = ...
file: Union[IO[str], IO[bytes]] = ...
def read(self, size: int) -> bytes: ...
def readline(self) -> bytes: ...
def send(self, data: bytes) -> None: ...