MCPcopy Create free account
hub / github.com/python/mypy / maybe_natively_call_exit

Function maybe_natively_call_exit

mypyc/irbuild/statement.py:1125–1150  ·  view source on GitHub ↗
(exc_info: bool)

Source from the content-addressed store, hash-verified

1123 value = emit_await(builder, value, line)
1124
1125 def maybe_natively_call_exit(exc_info: bool) -> Value:
1126 if exc_info:
1127 args = get_sys_exc_info(builder)
1128 else:
1129 none = builder.none_object()
1130 args = [none, none, none]
1131
1132 if is_native:
1133 assert isinstance(mgr_v.type, RInstance), mgr_v.type
1134 exit_val = builder.gen_method_call(
1135 builder.read(mgr, line),
1136 f"__{al}exit__",
1137 arg_values=args,
1138 line=line,
1139 result_type=none_rprimitive,
1140 )
1141 else:
1142 assert exit_ is not None
1143 exit_val = builder.py_call(
1144 builder.read(exit_, line), [builder.read(mgr, line)] + args, line
1145 )
1146
1147 if is_async:
1148 return emit_await(builder, exit_val, line)
1149 else:
1150 return exit_val
1151
1152 def try_body() -> None:
1153 if target:

Callers 2

except_bodyFunction · 0.85
finally_bodyFunction · 0.85

Calls 7

get_sys_exc_infoFunction · 0.85
isinstanceFunction · 0.85
emit_awaitFunction · 0.85
none_objectMethod · 0.45
gen_method_callMethod · 0.45
readMethod · 0.45
py_callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…