Skip to content

Commit e1db60d

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 1ca4b28 commit e1db60d

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

Src/IronPython/Compiler/Ast/AstMethods.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ internal static class AstMethods {
4242
public static readonly MethodInfo RemoveModule = GetMethod((Action<CodeContext, string, object>)PythonOps.RemoveModule);
4343
public static readonly MethodInfo ModuleStarted = GetMethod((Action<CodeContext, ModuleOptions>)PythonOps.ModuleStarted);
4444
public static readonly MethodInfo MakeRethrownException = GetMethod((Func<CodeContext, Exception>)PythonOps.MakeRethrownException);
45-
public static readonly MethodInfo MakeRethrowExceptionWorker = GetMethod((Func<Exception, Exception>)PythonOps.MakeRethrowExceptionWorker);
4645
public static readonly MethodInfo MakeException = GetMethod((Func<CodeContext, object, object, Exception>)PythonOps.MakeException);
4746
public static readonly MethodInfo MakeSlice = GetMethod((Func<object, object, object, Slice>)PythonOps.MakeSlice);
4847
public static readonly MethodInfo GetExceptionInfoLocal = GetMethod((Func<CodeContext, Exception, PythonTuple>)PythonOps.GetExceptionInfoLocal);

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: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,15 +2161,7 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
21612161
PythonTuple t = GetExceptionInfo(context);
21622162

21632163
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, true);
2164-
return MakeRethrowExceptionWorker(e);
2165-
}
2166-
/// <summary>
2167-
/// helper function for re-raised exception.
2168-
/// This entry point is used by 'raise' inside 'with' statement
2169-
/// </summary>
2170-
/// <param name="e"></param>
2171-
/// <returns></returns>
2172-
public static Exception MakeRethrowExceptionWorker(Exception e) {
2164+
21732165
e.RemoveTraceBack();
21742166
ExceptionHelpers.UpdateForRethrow(e);
21752167
return e;

0 commit comments

Comments
 (0)