private MSAst.Expression MakeExitCall(MSAst.ParameterExpression exit, MSAst.Expression exception) {
// The 'with' statement's exceptional clause explicitly does not set the thread's current exception information.
// So while the pseudo code says:
// exit(*sys.exc_info())
// we'll actually do:
// exit(*PythonOps.GetExceptionInfoLocal($exception))
return GlobalParent.Convert(
typeof(bool),
ConversionResultKind.ExplicitCast,
Parent.Invoke(
new CallSignature(ArgumentType.List),
Parent.LocalContext,
exit,
Ast.Call(
AstMethods.GetExceptionInfoLocal,
Parent.LocalContext,
exception
)
)
);
}