From f45d8eae660bb4c3311ba3baa53d6a3f390dd72b Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 28 Jul 2019 13:23:34 +0100 Subject: [PATCH] [stream-refactor] replace cutpaste with Stream.accept() in mitogen.unix --- mitogen/unix.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mitogen/unix.py b/mitogen/unix.py index 1f48c6b2..c0d2bb9c 100644 --- a/mitogen/unix.py +++ b/mitogen/unix.py @@ -148,9 +148,7 @@ class Listener(mitogen.core.Protocol): stream.name = u'unix_client.%d' % (pid,) stream.protocol.auth_id = mitogen.context_id stream.protocol.is_privileged = True - side = mitogen.core.Side(stream, sock) - stream.receive_side = side - stream.transmit_side = side + stream.accept(sock, sock) LOG.debug('%r: accepted %r', self, stream) self._router.register(context, stream) @@ -167,9 +165,7 @@ def _connect(path, broker, sock): router = mitogen.master.Router(broker=broker) stream = mitogen.core.MitogenProtocol.build_stream(router, remote_id) - side = mitogen.core.Side(stream, sock) - stream.transmit_side = side - stream.receive_side = side + stream.accept(sock, sock) stream.name = u'unix_listener.%d' % (pid,) mitogen.core.listen(stream, 'disconnect', _cleanup)