diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/asyncio/transports.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/asyncio/transports.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/asyncio/transports.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/tools/python3/src/Lib/asyncio/transports.py b/contrib/tools/python3/src/Lib/asyncio/transports.py index 45e155c94c..06143ed829 100644 --- a/contrib/tools/python3/src/Lib/asyncio/transports.py +++ b/contrib/tools/python3/src/Lib/asyncio/transports.py @@ -9,8 +9,8 @@ __all__ = ( class BaseTransport: """Base class for transports.""" - __slots__ = ('_extra',) - + __slots__ = ('_extra',) + def __init__(self, extra=None): if extra is None: extra = {} @@ -29,8 +29,8 @@ class BaseTransport: Buffered data will be flushed asynchronously. No more data will be received. After all buffered data is flushed, the - protocol's connection_lost() method will (eventually) be - called with None as its argument. + protocol's connection_lost() method will (eventually) be + called with None as its argument. """ raise NotImplementedError @@ -46,8 +46,8 @@ class BaseTransport: class ReadTransport(BaseTransport): """Interface for read-only transports.""" - __slots__ = () - + __slots__ = () + def is_reading(self): """Return True if the transport is receiving.""" raise NotImplementedError @@ -72,8 +72,8 @@ class ReadTransport(BaseTransport): class WriteTransport(BaseTransport): """Interface for write-only transports.""" - __slots__ = () - + __slots__ = () + def set_write_buffer_limits(self, high=None, low=None): """Set the high- and low-water limits for write flow control. @@ -160,14 +160,14 @@ class Transport(ReadTransport, WriteTransport): except writelines(), which calls write() in a loop. """ - __slots__ = () - + __slots__ = () + class DatagramTransport(BaseTransport): """Interface for datagram (UDP) transports.""" - __slots__ = () - + __slots__ = () + def sendto(self, data, addr=None): """Send data to the transport. @@ -190,8 +190,8 @@ class DatagramTransport(BaseTransport): class SubprocessTransport(BaseTransport): - __slots__ = () - + __slots__ = () + def get_pid(self): """Get subprocess id.""" raise NotImplementedError @@ -259,8 +259,8 @@ class _FlowControlMixin(Transport): resume_writing() may be called. """ - __slots__ = ('_loop', '_protocol_paused', '_high_water', '_low_water') - + __slots__ = ('_loop', '_protocol_paused', '_high_water', '_low_water') + def __init__(self, extra=None, loop=None): super().__init__(extra) assert loop is not None @@ -276,9 +276,9 @@ class _FlowControlMixin(Transport): self._protocol_paused = True try: self._protocol.pause_writing() - except (SystemExit, KeyboardInterrupt): - raise - except BaseException as exc: + except (SystemExit, KeyboardInterrupt): + raise + except BaseException as exc: self._loop.call_exception_handler({ 'message': 'protocol.pause_writing() failed', 'exception': exc, @@ -292,9 +292,9 @@ class _FlowControlMixin(Transport): self._protocol_paused = False try: self._protocol.resume_writing() - except (SystemExit, KeyboardInterrupt): - raise - except BaseException as exc: + except (SystemExit, KeyboardInterrupt): + raise + except BaseException as exc: self._loop.call_exception_handler({ 'message': 'protocol.resume_writing() failed', 'exception': exc, |