clean python 3 specific stuff from stdlib/@python2 stubs (#5451)

This commit is contained in:
Akuli
2021-05-15 01:19:05 +03:00
committed by GitHub
parent f94d838814
commit 5ec4f06263
121 changed files with 1024 additions and 4801 deletions

View File

@@ -13,8 +13,6 @@ MSG_OOB: int
FTP_PORT: int
MAXLINE: int
CRLF: str
if sys.version_info >= (3,):
B_CRLF: bytes
class Error(Exception): ...
class error_reply(Error): ...
@@ -40,35 +38,11 @@ class FTP:
af: int
lastresp: str
if sys.version_info >= (3,):
file: Optional[TextIO]
encoding: str
def __enter__(self: _T) -> _T: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...
else:
file: Optional[BinaryIO]
if sys.version_info >= (3, 3):
source_address: Optional[Tuple[str, int]]
def __init__(
self,
host: Text = ...,
user: Text = ...,
passwd: Text = ...,
acct: Text = ...,
timeout: float = ...,
source_address: Optional[Tuple[str, int]] = ...,
) -> None: ...
def connect(
self, host: Text = ..., port: int = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ...
) -> str: ...
else:
def __init__(
self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., timeout: float = ...
) -> None: ...
def connect(self, host: Text = ..., port: int = ..., timeout: float = ...) -> str: ...
file: Optional[BinaryIO]
def __init__(
self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., timeout: float = ...
) -> None: ...
def connect(self, host: Text = ..., port: int = ..., timeout: float = ...) -> str: ...
def getwelcome(self) -> str: ...
def set_debuglevel(self, level: int) -> None: ...
def debug(self, level: int) -> None: ...
@@ -108,8 +82,6 @@ class FTP:
def nlst(self, *args: Text) -> List[str]: ...
# Technically only the last arg can be a Callable but ...
def dir(self, *args: Union[str, Callable[[str], None]]) -> None: ...
if sys.version_info >= (3, 3):
def mlsd(self, path: Text = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, Dict[str, str]]]: ...
def rename(self, fromname: Text, toname: Text) -> str: ...
def delete(self, filename: Text) -> str: ...
def cwd(self, dirname: Text) -> str: ...
@@ -141,16 +113,13 @@ class FTP_TLS(FTP):
def auth(self) -> str: ...
def prot_p(self) -> str: ...
def prot_c(self) -> str: ...
if sys.version_info >= (3, 3):
def ccc(self) -> str: ...
if sys.version_info < (3,):
class Netrc:
def __init__(self, filename: Optional[Text] = ...) -> None: ...
def get_hosts(self) -> List[str]: ...
def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ...
def get_macros(self) -> List[str]: ...
def get_macro(self, macro: Text) -> Tuple[str, ...]: ...
class Netrc:
def __init__(self, filename: Optional[Text] = ...) -> None: ...
def get_hosts(self) -> List[str]: ...
def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ...
def get_macros(self) -> List[str]: ...
def get_macro(self, macro: Text) -> Tuple[str, ...]: ...
def parse150(resp: str) -> Optional[int]: ... # undocumented
def parse227(resp: str) -> Tuple[str, int]: ... # undocumented