From 09128f87e695bf2309ddf132d9d9f691f64ffc07 Mon Sep 17 00:00:00 2001 From: abdul124 Date: Mon, 19 Aug 2024 11:46:30 +0800 Subject: [PATCH] coredevice/comm_kernel: map exceptions to correct names --- artiq/coredevice/comm_kernel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/artiq/coredevice/comm_kernel.py b/artiq/coredevice/comm_kernel.py index 73a480ef4..7275ba8d2 100644 --- a/artiq/coredevice/comm_kernel.py +++ b/artiq/coredevice/comm_kernel.py @@ -3,6 +3,7 @@ import logging import traceback import numpy import socket +import builtins from enum import Enum from fractions import Fraction from collections import namedtuple @@ -616,9 +617,10 @@ class CommKernel: self._write_int32(embedding_map.store_str(function)) else: exn_type = type(exn) - if exn_type in (ZeroDivisionError, ValueError, IndexError, RuntimeError) or \ - hasattr(exn, "artiq_builtin"): - name = "0:{}".format(exn_type.__name__) + if exn_type in builtins.__dict__.values(): + name = "0:{}".format(exn_type.__qualname__) + elif hasattr(exn, "artiq_builtin"): + name = "0:{}.{}".format(exn_type.__module__, exn_type.__qualname__) else: exn_id = embedding_map.store_object(exn_type) name = "{}:{}.{}".format(exn_id,