Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/core/IronPython/Compiler/Ast/AstMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ internal static class AstMethods {
public static readonly MethodInfo RemoveModule = GetMethod((Action<CodeContext, string, object>)PythonOps.RemoveModule);
public static readonly MethodInfo ModuleStarted = GetMethod((Action<CodeContext, ModuleOptions>)PythonOps.ModuleStarted);
public static readonly MethodInfo MakeRethrownException = GetMethod((Func<CodeContext, Exception>)PythonOps.MakeRethrownException);
public static readonly MethodInfo MakeRethrowExceptionWorker = GetMethod((Func<Exception, Exception>)PythonOps.MakeRethrowExceptionWorker);
public static readonly MethodInfo MakeException = GetMethod((Func<CodeContext, object, Exception>)PythonOps.MakeException);
public static readonly MethodInfo MakeExceptionWithCause = GetMethod((Func<CodeContext, object, object, Exception>)PythonOps.MakeExceptionWithCause);
public static readonly MethodInfo MakeSlice = GetMethod((Func<object, object, object, Slice>)PythonOps.MakeSlice);
Expand Down
4 changes: 2 additions & 2 deletions src/core/IronPython/Compiler/Ast/WithStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ public override MSAst.Expression Reduce() {
UpdateLineUpdated(true),
Ast.Throw(
Ast.Call(
AstMethods.MakeRethrowExceptionWorker,
exception
AstMethods.MakeRethrownException,
Parent.LocalContext
)
)
)
Expand Down
15 changes: 1 addition & 14 deletions src/core/IronPython/Runtime/Operations/PythonOps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2468,20 +2468,7 @@ public static PythonTuple GetExceptionInfo(CodeContext/*!*/ context) {
public static Exception MakeRethrownException(CodeContext/*!*/ context) {
PythonTuple t = GetExceptionInfo(context);
Debug.Assert(t[1] == GetRawContextException());
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
return MakeRethrowExceptionWorker(e);
}

/// <summary>
/// helper function for re-raised exception.
/// This entry point is used by 'raise' inside 'with' statement
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public static Exception MakeRethrowExceptionWorker(Exception e) {
e.RemoveTraceBack();
ExceptionHelpers.UpdateForRethrow(e);
return e;
return MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
}

public static Exception MakeException(CodeContext/*!*/ context, object exception) {
Expand Down
Loading