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

Function try_finally_try

mypyc/irbuild/statement.py:775–793  ·  view source on GitHub ↗
(
    builder: IRBuilder,
    err_handler: BasicBlock,
    return_entry: BasicBlock,
    main_entry: BasicBlock,
    try_body: GenFunc,
)

Source from the content-addressed store, hash-verified

773
774
775def try_finally_try(
776 builder: IRBuilder,
777 err_handler: BasicBlock,
778 return_entry: BasicBlock,
779 main_entry: BasicBlock,
780 try_body: GenFunc,
781) -> Register | AssignmentTarget | None:
782 # Compile the try block with an error handler
783 control = TryFinallyNonlocalControl(return_entry)
784 builder.builder.push_error_handler(err_handler)
785
786 builder.nonlocal_control.append(control)
787 builder.goto_and_activate(BasicBlock())
788 try_body()
789 builder.goto(main_entry)
790 builder.nonlocal_control.pop()
791 builder.builder.pop_error_handler()
792
793 return control.ret_reg
794
795
796def try_finally_entry_blocks(

Callers 1

Calls 9

BasicBlockClass · 0.90
try_bodyFunction · 0.85
push_error_handlerMethod · 0.80
appendMethod · 0.80
pop_error_handlerMethod · 0.80
goto_and_activateMethod · 0.45
gotoMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…