MCPcopy Index your code
hub / github.com/cool-RR/PySnooper / _reraise_with_existing_context

Function _reraise_with_existing_context

tests/mini_toolbox/contextlib.py:274–282  ·  view source on GitHub ↗
(exc_details)

Source from the content-addressed store, hash-verified

272 return _fix_exception_context
273
274 def _reraise_with_existing_context(exc_details):
275 try:
276 # bare "raise exc_details[1]" replaces our carefully
277 # set-up context
278 fixed_ctx = exc_details[1].__context__
279 raise exc_details[1]
280 except BaseException:
281 exc_details[1].__context__ = fixed_ctx
282 raise
283else:
284 # No exception context in Python 2
285 def _make_context_fixer(frame_exc):

Callers 1

__exit__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected