diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-11-05 14:27:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-11-05 14:27:41 (GMT) |
commit | 004adb91f6e05ac711b0554bbd0415a48fed623c (patch) | |
tree | 9325ab7de23395c0ceac21cf41c49be001be4240 /Lib/asyncio/selector_events.py | |
parent | 7e8b8678f141d4e8198002972219895280b2d62d (diff) | |
download | cpython-004adb91f6e05ac711b0554bbd0415a48fed623c.zip cpython-004adb91f6e05ac711b0554bbd0415a48fed623c.tar.gz cpython-004adb91f6e05ac711b0554bbd0415a48fed623c.tar.bz2 |
asyncio: Move loop attribute to _FlowControlMixin
Move the _loop attribute from the constructor of _SelectorTransport,
_ProactorBasePipeTransport and _UnixWritePipeTransport classes to the
constructor of the _FlowControlMixin class.
Add also an assertion to explicit that the parent class must ensure that the
loop is defined (not None)
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index c5debf8..116d380 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -447,7 +447,7 @@ class _SelectorTransport(transports._FlowControlMixin, _buffer_factory = bytearray # Constructs initial value for self._buffer. def __init__(self, loop, sock, protocol, extra, server=None): - super().__init__(extra) + super().__init__(extra, loop) self._extra['socket'] = sock self._extra['sockname'] = sock.getsockname() if 'peername' not in self._extra: @@ -455,7 +455,6 @@ class _SelectorTransport(transports._FlowControlMixin, self._extra['peername'] = sock.getpeername() except socket.error: self._extra['peername'] = None - self._loop = loop self._sock = sock self._sock_fd = sock.fileno() self._protocol = protocol |