MCPcopy Index your code
hub / github.com/python/cpython / traceback_cm

Function traceback_cm

Tools/c-analyzer/c_common/scriptutil.py:218–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217 @contextlib.contextmanager
218 def traceback_cm():
219 restore = loggingutil.hide_emit_errors()
220 try:
221 yield
222 except BrokenPipeError:
223 # It was piped to "head" or something similar.
224 pass
225 except NotImplementedError:
226 raise # re-raise
227 except Exception as exc:
228 if not showtb:
229 sys.exit(f'ERROR: {exc}')
230 raise # re-raise
231 except KeyboardInterrupt:
232 if not showtb:
233 sys.exit('\nINTERRUPTED')
234 raise # re-raise
235 except BaseException as exc:
236 if not showtb:
237 sys.exit(f'{type(exc).__name__}: {exc}')
238 raise # re-raise
239 finally:
240 restore()
241 ns[key] = traceback_cm()
242 return key
243 return process_args

Callers 1

process_argsFunction · 0.85

Calls 2

restoreFunction · 0.70
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…