mirror of https://github.com/m-labs/artiq.git
style
This commit is contained in:
parent
785b2736a0
commit
a808d26fc2
|
@ -183,7 +183,7 @@ def setup_diagnostics(experiment_file, repository_path):
|
||||||
if repository_path is not None:
|
if repository_path is not None:
|
||||||
message = message.replace(repository_path, "<repository>")
|
message = message.replace(repository_path, "<repository>")
|
||||||
|
|
||||||
if diagnostic.level == 'warning':
|
if diagnostic.level == "warning":
|
||||||
logging.warn(message)
|
logging.warn(message)
|
||||||
else:
|
else:
|
||||||
logging.error(message)
|
logging.error(message)
|
||||||
|
@ -200,6 +200,7 @@ def setup_diagnostics(experiment_file, repository_path):
|
||||||
# wrapping it in layers of indirection.
|
# wrapping it in layers of indirection.
|
||||||
artiq.coredevice.core._DiagnosticEngine.render_diagnostic = render_diagnostic
|
artiq.coredevice.core._DiagnosticEngine.render_diagnostic = render_diagnostic
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
sys.stdout = LogForwarder()
|
sys.stdout = LogForwarder()
|
||||||
sys.stderr = LogForwarder()
|
sys.stderr = LogForwarder()
|
||||||
|
@ -268,10 +269,10 @@ def main():
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
lines = ["Terminating with exception\n"]
|
lines = ["Terminating with exception\n"]
|
||||||
lines += traceback.format_exception_only(type(exc), exc)
|
lines += traceback.format_exception_only(type(exc), exc)
|
||||||
if hasattr(exc, 'parent_traceback'):
|
if hasattr(exc, "parent_traceback"):
|
||||||
lines += exc.parent_traceback
|
lines += exc.parent_traceback
|
||||||
logging.error("".join(lines).rstrip(),
|
logging.error("".join(lines).rstrip(),
|
||||||
exc_info=not hasattr(exc, 'parent_traceback'))
|
exc_info=not hasattr(exc, "parent_traceback"))
|
||||||
finally:
|
finally:
|
||||||
device_mgr.close_devices()
|
device_mgr.close_devices()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue