From 9238e09ae81abbb95d7664845bceda3cb7665a47 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 14 Feb 2018 19:45:46 +0545 Subject: [PATCH] core: Restore behaviour of unpickling Router-specific Context subclass --- mitogen/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mitogen/core.py b/mitogen/core.py index aae36a76..e8b98ecb 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -794,7 +794,7 @@ def _unpickle_context(router, context_id, name): assert isinstance(router, Router) assert isinstance(context_id, (int, long)) and context_id > 0 assert isinstance(name, basestring) and len(name) < 100 - return Context(router, context_id, name) + return router.context_class(router, context_id, name) class Waker(BasicStream): @@ -883,6 +883,8 @@ class IoLogger(BasicStream): class Router(object): + context_class = Context + def __init__(self, broker): self.broker = broker listen(broker, 'shutdown', self.on_broker_shutdown)