Skip to content

Commit 1714606

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 2aca667 commit 1714606

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

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
@@ -2469,16 +2469,6 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
24692469
PythonTuple t = GetExceptionInfo(context);
24702470
Debug.Assert(t[1] == GetRawContextException());
24712471
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
2472-
return MakeRethrowExceptionWorker(e);
2473-
}
2474-
2475-
/// <summary>
2476-
/// helper function for re-raised exception.
2477-
/// This entry point is used by 'raise' inside 'with' statement
2478-
/// </summary>
2479-
/// <param name="e"></param>
2480-
/// <returns></returns>
2481-
public static Exception MakeRethrowExceptionWorker(Exception e) {
24822472
e.RemoveTraceBack();
24832473
ExceptionHelpers.UpdateForRethrow(e);
24842474
return e;

0 commit comments

Comments
 (0)