Skip to content

Commit 4bcd946

Browse files
committed
Remove MakeRethrowExceptionWorker
1 parent 6391b16 commit 4bcd946

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
@@ -2273,16 +2273,6 @@ public static Exception MakeRethrownException(CodeContext/*!*/ context) {
22732273
PythonTuple t = GetExceptionInfo(context);
22742274
Debug.Assert(t[1] == GetRawContextException());
22752275
Exception e = MakeExceptionWorker(context, t[0], t[1], t[2], null, suppressContext: false, forRethrow: true);
2276-
return MakeRethrowExceptionWorker(e);
2277-
}
2278-
2279-
/// <summary>
2280-
/// helper function for re-raised exception.
2281-
/// This entry point is used by 'raise' inside 'with' statement
2282-
/// </summary>
2283-
/// <param name="e"></param>
2284-
/// <returns></returns>
2285-
public static Exception MakeRethrowExceptionWorker(Exception e) {
22862276
e.RemoveTraceBack();
22872277
ExceptionHelpers.UpdateForRethrow(e);
22882278
return e;

0 commit comments

Comments
 (0)