Skip to content

Commit 5fc6ce0

Browse files
Merge pull request #400 from Distributive-Network/philippe/387-fix
check for SystemExit before scheduling timer
2 parents 7a2ffd0 + 0ea5589 commit 5fc6ce0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/internalBinding/timers.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ using AsyncHandle = PyEventLoop::AsyncHandle;
2323
*/
2424

2525
static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) {
26+
if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) {
27+
// quit, exit or sys.exit was called (and raised SystemExit)
28+
return false;
29+
}
30+
2631
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
2732
JS::HandleValue jobArgVal = args.get(0);
2833
double delaySeconds = args.get(1).toNumber();

0 commit comments

Comments
 (0)