Skip to content

Commit

Permalink
etype from builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 25, 2024
1 parent 8edb4c2 commit 4cc697f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spyder_kernels/comms/commbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import sys
import uuid
import traceback
import builtins


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -90,7 +91,12 @@ def from_json(cls, json_data):
instance = cls.__new__(cls)
instance.call_name = json_data["call_name"]
instance.call_id = json_data["call_id"]
instance.etype = type(json_data["etype"], (Exception,), {})
etype = json_data["etype"]
instance.etype = getattr(
builtins,
etype,
type(etype, (Exception,), {})
)
instance.error = instance.etype(json_data["args"])
instance.tb = traceback.StackSummary.from_list(json_data["tb"])
return instance
Expand Down

0 comments on commit 4cc697f

Please sign in to comment.