(
builder: IRBuilder, finally_block: BasicBlock, finally_body: GenFunc, old_exc: Value
)
| 825 | |
| 826 | |
| 827 | def 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 | |
| 842 | def try_finally_resolve_control( |
no test coverage detected
searching dependent graphs…