forked from M-Labs/artiq
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:
|
||||
message = message.replace(repository_path, "<repository>")
|
||||
|
||||
if diagnostic.level == 'warning':
|
||||
if diagnostic.level == "warning":
|
||||
logging.warn(message)
|
||||
else:
|
||||
logging.error(message)
|
||||
@ -200,6 +200,7 @@ def setup_diagnostics(experiment_file, repository_path):
|
||||
# wrapping it in layers of indirection.
|
||||
artiq.coredevice.core._DiagnosticEngine.render_diagnostic = render_diagnostic
|
||||
|
||||
|
||||
def main():
|
||||
sys.stdout = LogForwarder()
|
||||
sys.stderr = LogForwarder()
|
||||
@ -268,10 +269,10 @@ def main():
|
||||
except Exception as exc:
|
||||
lines = ["Terminating with exception\n"]
|
||||
lines += traceback.format_exception_only(type(exc), exc)
|
||||
if hasattr(exc, 'parent_traceback'):
|
||||
if hasattr(exc, "parent_traceback"):
|
||||
lines += exc.parent_traceback
|
||||
logging.error("".join(lines).rstrip(),
|
||||
exc_info=not hasattr(exc, 'parent_traceback'))
|
||||
exc_info=not hasattr(exc, "parent_traceback"))
|
||||
finally:
|
||||
device_mgr.close_devices()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user