Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4dd10fe

Browse files
authored
Fix a signature in smtpd.SMTPServer (#5203)
Fixes #5202. Use an appropriate type for the data argument of smtpd.SMTPServer.process_message.
1 parent 087435c commit 4dd10fe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

stdlib/smtpd.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import asynchat
22
import asyncore
33
import socket
44
import sys
5-
from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type
5+
from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type, Union
66

77
_Address = Tuple[str, int] # (host, port)
88

@@ -79,7 +79,9 @@ class SMTPServer(asyncore.dispatcher):
7979
else:
8080
def __init__(self, localaddr: _Address, remoteaddr: _Address, data_size_limit: int = ...) -> None: ...
8181
def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ...
82-
def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ...
82+
def process_message(
83+
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str], **kwargs: Any
84+
) -> Optional[str]: ...
8385

8486
class DebuggingServer(SMTPServer): ...
8587
class PureProxy(SMTPServer): ...

0 commit comments

Comments
 (0)