Skip to content

Commit 3fd1b0f

Browse files
Use the internal function.
1 parent 01cb55d commit 3fd1b0f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Modules/_testcapimodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,7 @@ pending_threadfunc(PyObject *self, PyObject *arg)
24452445
Py_INCREF(callable);
24462446

24472447
Py_BEGIN_ALLOW_THREADS
2448+
/* XXX Use the internal _Py_AddPendingCall(). */
24482449
r = Py_AddPendingCall(&_pending_callback, callable);
24492450
Py_END_ALLOW_THREADS
24502451

Modules/signalmodule.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <process.h>
2020
#endif
2121
#endif
22+
#include "internal/pycore_pystate.h"
2223

2324
#ifdef HAVE_SIGNAL_H
2425
#include <signal.h>
@@ -287,8 +288,9 @@ trip_signal(int sig_num)
287288
{
288289
/* Py_AddPendingCall() isn't signal-safe, but we
289290
still use it for this exceptional case. */
290-
Py_AddPendingCall(report_wakeup_send_error,
291-
(void *)(intptr_t) last_error);
291+
_Py_AddPendingCall(_PyRuntime.interpreters.main,
292+
report_wakeup_send_error,
293+
(void *)(intptr_t) last_error);
292294
}
293295
}
294296
}
@@ -305,8 +307,9 @@ trip_signal(int sig_num)
305307
{
306308
/* Py_AddPendingCall() isn't signal-safe, but we
307309
still use it for this exceptional case. */
308-
Py_AddPendingCall(report_wakeup_write_error,
309-
(void *)(intptr_t)errno);
310+
_Py_AddPendingCall(_PyRuntime.interpreters.main,
311+
report_wakeup_write_error,
312+
(void *)(intptr_t)errno);
310313
}
311314
}
312315
}

0 commit comments

Comments
 (0)