asynchat + asyncore: Python 3 compatibility (#1402)

Includes an update to smtpd, which uses asynchat.
This commit is contained in:
Ray Kraesig
2017-06-20 13:15:58 -07:00
committed by Guido van Rossum
parent 86070643ac
commit 44127444d4
3 changed files with 56 additions and 46 deletions

View File

@@ -6,8 +6,8 @@ from typing import Union, Tuple, Sequence
class simple_producer:
def __init__(self, data: str, buffer_size: int = ...) -> None: ...
def more(self) -> str: ...
def __init__(self, data: bytes, buffer_size: int = ...) -> None: ...
def more(self) -> bytes: ...
class async_chat(asyncore.dispatcher):
ac_in_buffer_size = ... # type: int
@@ -18,12 +18,12 @@ class async_chat(asyncore.dispatcher):
def collect_incoming_data(self, data: bytes) -> None: ...
@abstractmethod
def found_terminator(self) -> None: ...
def set_terminator(self, term: Union[str, int, None]) -> None: ...
def get_terminator(self) -> Union[str, int, None]: ...
def set_terminator(self, term: Union[bytes, int, None]) -> None: ...
def get_terminator(self) -> Union[bytes, int, None]: ...
def handle_read(self) -> None: ...
def handle_write(self) -> None: ...
def handle_close(self) -> None: ...
def push(self, data: str) -> None: ...
def push(self, data: bytes) -> None: ...
def push_with_producer(self, producer: simple_producer) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
@@ -33,9 +33,9 @@ class async_chat(asyncore.dispatcher):
if sys.version_info < (3, 0):
class fifo:
def __init__(self, list: Sequence[Union[str, simple_producer]] = ...) -> None: ...
def __init__(self, list: Sequence[Union[bytes, simple_producer]] = ...) -> None: ...
def __len__(self) -> int: ...
def is_empty(self) -> bool: ...
def first(self) -> str: ...
def push(self, data: Union[str, simple_producer]) -> None: ...
def pop(self) -> Tuple[int, str]: ...
def first(self) -> bytes: ...
def push(self, data: Union[bytes, simple_producer]) -> None: ...
def pop(self) -> Tuple[int, bytes]: ...