Skip to content

Commit c98a855

Browse files
committed
Silently ignore SystemExit in thread runnable
1 parent 0fe66c9 commit c98a855

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ThreadModuleBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ long start(VirtualFrame frame, Object cls, Object callable, Object args, Object
247247
if (!IsBuiltinObjectProfile.profileObjectUncached(e.getUnreifiedException(), PythonBuiltinClassType.SystemExit)) {
248248
WriteUnraisableNode.getUncached().execute(e.getUnreifiedException(), IN_THREAD_STARTED_BY, callable);
249249
}
250+
// SystemExit is silently ignored (see _threadmodule.c: thread_run)
250251
} finally {
251252
curCount = (int) HiddenAttr.ReadNode.executeUncached(threadModule, THREAD_COUNT, 1);
252253
HiddenAttr.WriteNode.executeUncached(threadModule, THREAD_COUNT, curCount - 1);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/object/BuiltinClassProfiles.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ public static boolean profileObjectUncached(Object obj, PythonBuiltinClassType t
240240
return getUncached().profileObject(null, obj, type);
241241
}
242242

243+
public static boolean profileExceptionUncached(PException obj, PythonBuiltinClassType type) {
244+
return IsBuiltinObjectProfileNodeGen.getUncached().profileException(null, obj, type);
245+
}
246+
243247
public static IsBuiltinObjectExactProfile getUncached() {
244248
return IsBuiltinObjectExactProfileNodeGen.getUncached();
245249
}

0 commit comments

Comments
 (0)