MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / _handle_exceptions

Function _handle_exceptions

etc/scripts/numba_wrapper.py:103–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102@contextlib.contextmanager
103def _handle_exceptions() -> Iterator[None]:
104 try:
105 yield
106 except Exception as error:
107 # On error, we should we mimic the compiler-explorer Python wrapper's behavior
108 # in its traceback-hiding and exit code.
109 messages = traceback.format_exception_only(type(error), error)
110 sys.stderr.writelines(messages)
111 sys.exit(255)
112
113
114@contextlib.contextmanager

Callers 1

mainFunction · 0.85

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected