Skip to content

Commit 4781dbf

Browse files
smtpd: MailmanProxy was removed in 3.11 (#7365)
python/cpython#26617
1 parent a3bb5af commit 4781dbf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

stdlib/smtpd.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import asynchat
22
import asyncore
33
import socket
4+
import sys
45
from collections import defaultdict
56
from typing import Any
67

7-
__all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", "MailmanProxy"]
8+
if sys.version_info >= (3, 11):
9+
__all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy"]
10+
else:
11+
__all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", "MailmanProxy"]
812

913
_Address = tuple[str, int] # (host, port)
1014

@@ -81,5 +85,6 @@ class DebuggingServer(SMTPServer): ...
8185
class PureProxy(SMTPServer):
8286
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]
8387

84-
class MailmanProxy(PureProxy):
85-
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]
88+
if sys.version_info < (3, 11):
89+
class MailmanProxy(PureProxy):
90+
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]

0 commit comments

Comments
 (0)