From 1a69727b75390d118537d463b9925a49043e2128 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 13 Jun 2021 20:19:52 -0400 Subject: [PATCH] Fix exception typing --- tractor/_exceptions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tractor/_exceptions.py b/tractor/_exceptions.py index 07ea4e6..d213a20 100644 --- a/tractor/_exceptions.py +++ b/tractor/_exceptions.py @@ -1,7 +1,7 @@ """ Our classy exception set. """ -from typing import Dict, Any, Optional +from typing import Dict, Any, Optional, Type import importlib import builtins import traceback @@ -18,7 +18,7 @@ class RemoteActorError(Exception): def __init__( self, message: str, - suberror_type: Optional[Exception] = None, + suberror_type: Optional[Type[BaseException]] = None, **msgdata ) -> None: @@ -84,7 +84,7 @@ def unpack_error( tb_str = error.get('tb_str', '') message = f"{chan.uid}\n" + tb_str type_name = error['type_str'] - suberror_type = Exception + suberror_type: Type[BaseException] = Exception if type_name == 'ContextCancelled': err_type = ContextCancelled