mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Fix a signature in smtpd.SMTPServer (#5203)
Fixes #5202. Use an appropriate type for the data argument of smtpd.SMTPServer.process_message.
This commit is contained in:
@@ -2,7 +2,7 @@ import asynchat
|
||||
import asyncore
|
||||
import socket
|
||||
import sys
|
||||
from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type
|
||||
from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type, Union
|
||||
|
||||
_Address = Tuple[str, int] # (host, port)
|
||||
|
||||
@@ -79,7 +79,9 @@ class SMTPServer(asyncore.dispatcher):
|
||||
else:
|
||||
def __init__(self, localaddr: _Address, remoteaddr: _Address, data_size_limit: int = ...) -> None: ...
|
||||
def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ...
|
||||
def process_message(
|
||||
self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: Union[bytes, str], **kwargs: Any
|
||||
) -> Optional[str]: ...
|
||||
|
||||
class DebuggingServer(SMTPServer): ...
|
||||
class PureProxy(SMTPServer): ...
|
||||
|
||||
Reference in New Issue
Block a user