Skip to content

Commit d0fbabf

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 29308e7 commit d0fbabf

3 files changed

Lines changed: 2 additions & 13 deletions

File tree

src/core/IronPython/Compiler/Ast/AstMethods.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ internal static class AstMethods {
3737
public static readonly MethodInfo RemoveModule = GetMethod((Action<CodeContext, string, object>)PythonOps.RemoveModule);
3838
public static readonly MethodInfo ModuleStarted = GetMethod((Action<CodeContext, ModuleOptions>)PythonOps.ModuleStarted);
3939
public static readonly MethodInfo MakeRethrownException = GetMethod((Func<CodeContext, Exception>)PythonOps.MakeRethrownException);
40-
public static readonly MethodInfo MakeRethrowExceptionWorker = GetMethod((Func<Exception, Exception>)PythonOps.MakeRethrowExceptionWorker);
4140
public static readonly MethodInfo MakeException = GetMethod((Func<CodeContext, object, Exception>)PythonOps.MakeException);
4241
public static readonly MethodInfo MakeExceptionWithCause = GetMethod((Func<CodeContext, object, object, Exception>)PythonOps.MakeExceptionWithCause);
4342
public static readonly MethodInfo MakeSlice = GetMethod((Func<object, object, object, Slice>)PythonOps.MakeSlice);

src/core/IronPython/Compiler/Ast/WithStatement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ public override MSAst.Expression Reduce() {
206206
UpdateLineUpdated(true),
207207
Ast.Throw(
208208
Ast.Call(
209-
AstMethods.MakeRethrowExceptionWorker,
210-
exception
209+
AstMethods.MakeRethrownException,
210+
Parent.LocalContext
211211
)
212212
)
213213
)

src/core/IronPython/Runtime/Operations/PythonOps.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,16 +2505,6 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
25052505
PythonTuple t = GetExceptionInfo(context);
25062506
Debug.Assert(t[1] == GetRawContextException());
25072507
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
2508-
return MakeRethrowExceptionWorker(e);
2509-
}
2510-
2511-
/// <summary>
2512-
/// helper function for re-raised exception.
2513-
/// This entry point is used by 'raise' inside 'with' statement
2514-
/// </summary>
2515-
/// <param name="e"></param>
2516-
/// <returns></returns>
2517-
public static Exception MakeRethrowExceptionWorker(Exception e) {
25182508
e.RemoveTraceBack();
25192509
ExceptionHelpers.UpdateForRethrow(e);
25202510
return e;

0 commit comments

Comments
 (0)