mirror of
https://github.com/python/cpython.git
synced 2026-04-13 15:20:52 +00:00
25 lines
574 B
C
25 lines
574 B
C
#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);
|
|
}
|