/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Modules/_testlimitedcapi/threadstate.c
25 строк
574 B
Petr Viktorin
gh-144748: Make PyErr_CheckSignals raise the exception scheduled by PyThreadState_SetAsyncExc (GH-145178)
02 мар 2026, 13:47
Не верифицирован
02 мар 2026, 13:47
3b276f3
Код
Авторство
О чём код?
#include "parts.h" #include "util.h" static PyObject * threadstate_set_async_exc(PyObject *module, PyObject *args) { unsigned long id; PyObject *exc; if (!PyArg_ParseTuple(args, "kO", &id, &exc)) { return NULL; } int result = PyThreadState_SetAsyncExc(id, exc); return PyLong_FromLong(result); } static PyMethodDef test_methods[] = { {"threadstate_set_async_exc", threadstate_set_async_exc, METH_VARARGS, NULL}, {NULL}, }; int _PyTestLimitedCAPI_Init_ThreadState(PyObject *m) { return PyModule_AddFunctions(m, test_methods); }