diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index 81fd9c00f..2be0ccac2 100644 --- a/artiq/coredevice/core.py +++ b/artiq/coredevice/core.py @@ -20,7 +20,7 @@ def _render_diagnostic(diagnostic): return "\n".join(lines) class _DiagnosticEngine(diagnostic.Engine): - def print_diagnostic(self, diagnostic): + def render_diagnostic(self, diagnostic): sys.stderr.write(_render_diagnostic(diagnostic) + "\n") class CompileError(Exception): diff --git a/artiq/frontend/artiq_compile.py b/artiq/frontend/artiq_compile.py index efd198fa9..d7d9869ff 100755 --- a/artiq/frontend/artiq_compile.py +++ b/artiq/frontend/artiq_compile.py @@ -54,7 +54,6 @@ def main(): core.compile(exp.run, [exp_inst], {}, with_attr_writeback=False) except CompileError as error: - print(error.render_string(colored=True), file=sys.stderr) return finally: device_mgr.close_devices() diff --git a/artiq/frontend/artiq_run.py b/artiq/frontend/artiq_run.py index 0aa03ca33..4bb33c606 100755 --- a/artiq/frontend/artiq_run.py +++ b/artiq/frontend/artiq_run.py @@ -129,7 +129,6 @@ def run(with_file=False): exp_inst.run() exp_inst.analyze() except CompileError as error: - print(error.render_string(colored=True), file=sys.stderr) return except Exception as exn: if hasattr(exn, 'artiq_exception'): diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index d93ef2c31..db3f33c20 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -230,6 +230,7 @@ def main(): elif action == "terminate": break except CompileError as exc: + # TODO: This should be replaced with a proper DiagnosticEngine. message = "Cannot compile {}\n".format(experiment_file) + exc.render_string() if repository_path is not None: message = message.replace(repository_path, "")