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

Method get_exception

Lib/test/test_traceback.py:2317–2323  ·  view source on GitHub ↗
(self, exception_or_callable)

Source from the content-addressed store, hash-verified

2315class BaseExceptionReportingTests:
2316
2317 def get_exception(self, exception_or_callable):
2318 if isinstance(exception_or_callable, BaseException):
2319 return exception_or_callable
2320 try:
2321 exception_or_callable()
2322 except Exception as e:
2323 return e
2324
2325 callable_line = get_exception.__code__.co_firstlineno + 4
2326

Calls

no outgoing calls

Tested by

no test coverage detected