Skip to content

Commit 71bdaca

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 0c21155 commit 71bdaca

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
@@ -36,7 +36,6 @@ internal static class AstMethods {
3636
public static readonly MethodInfo RemoveModule = GetMethod((Action<CodeContext, string, object>)PythonOps.RemoveModule);
3737
public static readonly MethodInfo ModuleStarted = GetMethod((Action<CodeContext, ModuleOptions>)PythonOps.ModuleStarted);
3838
public static readonly MethodInfo MakeRethrownException = GetMethod((Func<CodeContext, Exception>)PythonOps.MakeRethrownException);
39-
public static readonly MethodInfo MakeRethrowExceptionWorker = GetMethod((Func<Exception, Exception>)PythonOps.MakeRethrowExceptionWorker);
4039
public static readonly MethodInfo MakeException = GetMethod((Func<CodeContext, object, object, Exception>)PythonOps.MakeException);
4140
public static readonly MethodInfo MakeSlice = GetMethod((Func<object, object, object, Slice>)PythonOps.MakeSlice);
4241
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
@@ -2178,15 +2178,7 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
21782178
PythonTuple t = GetExceptionInfo(context);
21792179

21802180
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, true);
2181-
return MakeRethrowExceptionWorker(e);
2182-
}
2183-
/// <summary>
2184-
/// helper function for re-raised exception.
2185-
/// This entry point is used by 'raise' inside 'with' statement
2186-
/// </summary>
2187-
/// <param name="e"></param>
2188-
/// <returns></returns>
2189-
public static Exception MakeRethrowExceptionWorker(Exception e) {
2181+
21902182
e.RemoveTraceBack();
21912183
ExceptionHelpers.UpdateForRethrow(e);
21922184
return e;

0 commit comments

Comments
 (0)