mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
asyncio.protocols: fix version availability (#4081)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -12,6 +12,8 @@ from asyncio.protocols import (
|
||||
DatagramProtocol as DatagramProtocol,
|
||||
SubprocessProtocol as SubprocessProtocol,
|
||||
)
|
||||
if sys.version_info >= (3, 7):
|
||||
from asyncio.protocols import BufferedProtocol as BufferedProtocol
|
||||
from asyncio.streams import (
|
||||
StreamReader as StreamReader,
|
||||
StreamWriter as StreamWriter,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from asyncio import transports
|
||||
from typing import Optional, Tuple, Union
|
||||
|
||||
@@ -11,9 +12,10 @@ class Protocol(BaseProtocol):
|
||||
def data_received(self, data: bytes) -> None: ...
|
||||
def eof_received(self) -> Optional[bool]: ...
|
||||
|
||||
class BufferedProtocol(BaseProtocol):
|
||||
def get_buffer(self, sizehint: int) -> bytearray: ...
|
||||
def buffer_updated(self, nbytes: int) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
class BufferedProtocol(BaseProtocol):
|
||||
def get_buffer(self, sizehint: int) -> bytearray: ...
|
||||
def buffer_updated(self, nbytes: int) -> None: ...
|
||||
|
||||
class DatagramProtocol(BaseProtocol):
|
||||
def datagram_received(self, data: bytes, addr: Tuple[str, int]) -> None: ...
|
||||
|
||||
@@ -10,7 +10,6 @@ asyncio.futures.Future._exception
|
||||
asyncio.futures.Future._loop
|
||||
asyncio.futures.Future._tb_logger
|
||||
asyncio.futures._TracebackLogger.__init__
|
||||
asyncio.protocols.BufferedProtocol
|
||||
asyncio.runners
|
||||
asyncio.tasks.Task.__init__
|
||||
asyncio.tasks.Task._wakeup
|
||||
|
||||
@@ -2,7 +2,6 @@ asyncio.Future.__init__
|
||||
asyncio.exceptions
|
||||
asyncio.futures.Future.__init__
|
||||
asyncio.futures._TracebackLogger.__init__
|
||||
asyncio.protocols.BufferedProtocol
|
||||
asyncio.runners
|
||||
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
|
||||
builtins.str.maketrans
|
||||
|
||||
Reference in New Issue
Block a user