From 583784d94cb77c8561c72396d8329fee145d9489 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 12 Oct 2019 19:15:44 +0200 Subject: [PATCH] Add missing exception to smtplib (#3348) Improve a few other types --- stdlib/3/smtplib.pyi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/3/smtplib.pyi b/stdlib/3/smtplib.pyi index 803b010bd..60e3a35b8 100644 --- a/stdlib/3/smtplib.pyi +++ b/stdlib/3/smtplib.pyi @@ -17,6 +17,7 @@ bCRLF: bytes OLDSTYLE_AUTH: Pattern[str] class SMTPException(OSError): ... +class SMTPNotSupportedError(SMTPException): ... class SMTPServerDisconnected(SMTPException): ... class SMTPResponseException(SMTPException): @@ -53,12 +54,13 @@ class _AuthObject(Protocol): class SMTP: debuglevel: int = ... + sock: Optional[socket] = ... # Type of file should match what socket.makefile() returns - file: Any = ... + file: Optional[Any] = ... helo_resp: Optional[bytes] = ... ehlo_msg: str = ... ehlo_resp: Optional[bytes] = ... - does_esmtp: int = ... + does_esmtp: bool = ... default_port: int = ... timeout: float esmtp_features: Dict[str, str] @@ -73,7 +75,6 @@ class SMTP: exc_value: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... def set_debuglevel(self, debuglevel: int) -> None: ... - sock: Optional[socket] def connect(self, host: str = ..., port: int = ..., source_address: Optional[_SourceAddress] = ...) -> _Reply: ... def send(self, s: Union[bytes, str]) -> None: ... @@ -116,6 +117,7 @@ class SMTP: def quit(self) -> _Reply: ... class SMTP_SSL(SMTP): + default_port: int = ... keyfile: Optional[str] certfile: Optional[str] context: SSLContext