From 5bd6bd06d10682c77a9a8e64e86ab7ce980c8a68 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 25 Jan 2019 13:14:35 +0000 Subject: [PATCH] parent: don't send messages on streams that no longer exist; closes #480 --- mitogen/parent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitogen/parent.py b/mitogen/parent.py index fad00b49..173fac74 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -1677,6 +1677,10 @@ class RouteMonitor(object): :param str name: Context name or :data:`None`. """ + if not stream: + # We may not have a stream during shutdown. + return + data = str(target_id) if name: data = '%s:%s' % (target_id, name)