From 4781dbf752f54fca2c09d6597dda527dd9285d97 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 22 Feb 2022 17:06:39 -0800 Subject: [PATCH] smtpd: MailmanProxy was removed in 3.11 (#7365) python/cpython#26617 --- stdlib/smtpd.pyi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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]