From 9a661bd27323e57ee88d6f563b5e2cc3429b7737 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 9 Mar 2016 17:22:15 +0100 Subject: [PATCH] hardware_testbench: clean up artiq_core_exeption printing --- artiq/test/hardware_testbench.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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