diff --git a/artiq/test/hardware_testbench.py b/artiq/test/hardware_testbench.py index a8726fce7..3cb0d3700 100644 --- a/artiq/test/hardware_testbench.py +++ b/artiq/test/hardware_testbench.py @@ -125,5 +125,7 @@ class ExperimentCase(unittest.TestCase): # Reduce amount of text on terminal. raise error from None except Exception as exn: - exn.args = exn.args[0] + "\n" + str(exn.artiq_core_exception), + if hasattr(exn, "artiq_core_exception"): + exn.args = "{}\n{}".format(exn.args[0], + exn.artiq_core_exception), raise exn