Skip to content

Commit 3b8a103

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent ddf1400 commit 3b8a103

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
@@ -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, object, Exception>)PythonOps.MakeException);
4241
public static readonly MethodInfo MakeSlice = GetMethod((Func<object, object, object, Slice>)PythonOps.MakeSlice);
4342
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
@@ -2193,15 +2193,7 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
21932193
PythonTuple t = GetExceptionInfo(context);
21942194

21952195
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, true);
2196-
return MakeRethrowExceptionWorker(e);
2197-
}
2198-
/// <summary>
2199-
/// helper function for re-raised exception.
2200-
/// This entry point is used by 'raise' inside 'with' statement
2201-
/// </summary>
2202-
/// <param name="e"></param>
2203-
/// <returns></returns>
2204-
public static Exception MakeRethrowExceptionWorker(Exception e) {
2196+
22052197
e.RemoveTraceBack();
22062198
ExceptionHelpers.UpdateForRethrow(e);
22072199
return e;

0 commit comments

Comments
 (0)