MCPcopy Index your code
hub / github.com/python/mypy / try_finally_body

Function try_finally_body

mypyc/irbuild/statement.py:827–839  ·  view source on GitHub ↗
(
    builder: IRBuilder, finally_block: BasicBlock, finally_body: GenFunc, old_exc: Value
)

Source from the content-addressed store, hash-verified

825
826
827def try_finally_body(
828 builder: IRBuilder, finally_block: BasicBlock, finally_body: GenFunc, old_exc: Value
829) -> tuple[BasicBlock, FinallyNonlocalControl]:
830 cleanup_block = BasicBlock()
831 # Compile the finally block with the nonlocal control flow overridden to restore exc_info
832 builder.builder.push_error_handler(cleanup_block)
833 finally_control = FinallyNonlocalControl(builder.nonlocal_control[-1], old_exc)
834 builder.nonlocal_control.append(finally_control)
835 builder.activate_block(finally_block)
836 finally_body()
837 builder.nonlocal_control.pop()
838
839 return cleanup_block, finally_control
840
841
842def try_finally_resolve_control(

Callers 1

Calls 7

BasicBlockClass · 0.90
finally_bodyFunction · 0.85
push_error_handlerMethod · 0.80
appendMethod · 0.80
activate_blockMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…