Add missing exception to smtplib (#3348)

Improve a few other types
This commit is contained in:
Sebastian Rittau
2019-10-12 19:15:44 +02:00
committed by GitHub
parent 6354bc8a10
commit 583784d94c

View File

@@ -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