Skip to content

Commit 993dba7

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 6b98092 commit 993dba7

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

Src/IronPython/Compiler/Ast/AstMethods.cs

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

Src/IronPython/Compiler/Ast/WithStatement.cs

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

Src/IronPython/Runtime/Operations/PythonOps.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,16 +2352,6 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
23522352
PythonTuple t = GetExceptionInfo(context);
23532353
Debug.Assert(t[1] == GetRawContextException());
23542354
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
2355-
return MakeRethrowExceptionWorker(e);
2356-
}
2357-
2358-
/// <summary>
2359-
/// helper function for re-raised exception.
2360-
/// This entry point is used by 'raise' inside 'with' statement
2361-
/// </summary>
2362-
/// <param name="e"></param>
2363-
/// <returns></returns>
2364-
public static Exception MakeRethrowExceptionWorker(Exception e) {
23652355
e.RemoveTraceBack();
23662356
ExceptionHelpers.UpdateForRethrow(e);
23672357
return e;

0 commit comments

Comments
 (0)