fakessh: IoPump() doesn't need Process reference.

wip-fakessh-exit-status
David Wilson 7 years ago
parent 8dad396e27
commit 175fe7a4e1

@ -80,8 +80,7 @@ class IoPump(mitogen.core.BasicStream):
_output_buf = '' _output_buf = ''
_closed = False _closed = False
def __init__(self, process, broker, stdin_fd, stdout_fd): def __init__(self, broker, stdin_fd, stdout_fd):
self.process = process
self._broker = broker self._broker = broker
self.receive_side = mitogen.core.Side(self, stdout_fd) self.receive_side = mitogen.core.Side(self, stdout_fd)
self.transmit_side = mitogen.core.Side(self, stdin_fd) self.transmit_side = mitogen.core.Side(self, stdin_fd)
@ -122,8 +121,9 @@ class IoPump(mitogen.core.BasicStream):
self.on_disconnect(broker) self.on_disconnect(broker)
def __repr__(self): def __repr__(self):
return 'IoPump(%r)' % ( return 'IoPump(%r, %r)' % (
self.process, self.receive_side.fd,
self.transmit_side.fd,
) )
@ -139,7 +139,7 @@ class Process(object):
self.proc = proc self.proc = proc
self.control_handle = router.add_handler(self._on_control) self.control_handle = router.add_handler(self._on_control)
self.stdin_handle = router.add_handler(self._on_stdin) self.stdin_handle = router.add_handler(self._on_stdin)
self.pump = IoPump(self, router.broker, stdin_fd, stdout_fd) self.pump = IoPump(router.broker, stdin_fd, stdout_fd)
self.stdin = None self.stdin = None
self.control = None self.control = None
self.wake_event = threading.Event() self.wake_event = threading.Event()

Loading…
Cancel
Save