diff --git a/mitogen/core.py b/mitogen/core.py index 60971c61..d60fbafc 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -957,8 +957,10 @@ class Context(object): def _unpickle_context(router, context_id, name): if not (isinstance(router, Router) and - isinstance(context_id, (int, long)) and context_id >= 0 and - isinstance(name, basestring) and len(name) < 100): + isinstance(context_id, (int, long)) and context_id >= 0 and ( + (name is None) or + (isinstance(name, basestring) and len(name) < 100)) + ): raise TypeError('cannot unpickle Context: bad input') return router.context_class(router, context_id, name)