From 12c1beed1092d09afaf1236af503283acb1f7c5c Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 5 Oct 2017 01:04:08 +0530 Subject: [PATCH] More dead code, some comments. --- examples/mitop.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/mitop.py b/examples/mitop.py index 3e235530..e10a76f0 100644 --- a/examples/mitop.py +++ b/examples/mitop.py @@ -152,17 +152,15 @@ def main(router, argv): host.recv = mitogen.core.Receiver(router) host.recv.host = host - host.recv.host_main = False host.tasks = [] select.add(host.recv) call_recv = host.context.call_async(remote_main, - mitogen.context_id, - host.recv.handle, - delay, - ) - call_recv.host = host - call_recv.host_main = True + mitogen.context_id, host.recv.handle, delay) + + # Adding call_recv to the select will cause CallError to be thrown by + # .get() if startup in the context fails, halt local_main() and cause + # the exception to be printed. select.add(call_recv) hosts.append(host)