From 26c6c6d0488aac2baa9593cae383eb6b81224898 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 29 Jan 2019 17:17:57 +0000 Subject: [PATCH] issue #498: fix shutdown crash Traceback (most recent call last): File "", line 2707, in _invoke File "", line 2480, in _on_del_route NameError: global name 'target_id' is not defined --- mitogen/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitogen/core.py b/mitogen/core.py index 7ceba02c..c94126a6 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -2473,7 +2473,8 @@ class Router(object): return target_id_s, _, name = bytes_partition(msg.data, b(':')) - context = self._context_by_id.get(int(target_id_s, 10)) + target_id = int(target_id_s, 10) + context = self._context_by_id.get(target_id) if context: fire(context, 'disconnect') else: