diff --git a/stdlib/smtpd.pyi b/stdlib/smtpd.pyi index 5ef11d924..037f62a8d 100644 --- a/stdlib/smtpd.pyi +++ b/stdlib/smtpd.pyi @@ -1,10 +1,14 @@ import asynchat import asyncore import socket +import sys from collections import defaultdict from typing import Any -__all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", "MailmanProxy"] +if sys.version_info >= (3, 11): + __all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy"] +else: + __all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", "MailmanProxy"] _Address = tuple[str, int] # (host, port) @@ -81,5 +85,6 @@ class DebuggingServer(SMTPServer): ... class PureProxy(SMTPServer): def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override] -class MailmanProxy(PureProxy): - def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override] +if sys.version_info < (3, 11): + class MailmanProxy(PureProxy): + def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]