summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index cf4b0e1..8ebe970 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1784,6 +1784,18 @@ raise_exception(PyObject *self, PyObject *args)
}
static PyObject *
+set_errno(PyObject *self, PyObject *args)
+{
+ int new_errno;
+
+ if (!PyArg_ParseTuple(args, "i:set_errno", &new_errno))
+ return NULL;
+
+ errno = new_errno;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
test_set_exc_info(PyObject *self, PyObject *args)
{
PyObject *orig_exc;
@@ -3208,6 +3220,7 @@ pymarshal_read_object_from_file(PyObject* self, PyObject *args)
static PyMethodDef TestMethods[] = {
{"raise_exception", raise_exception, METH_VARARGS},
{"raise_memoryerror", (PyCFunction)raise_memoryerror, METH_NOARGS},
+ {"set_errno", set_errno, METH_VARARGS},
{"test_config", (PyCFunction)test_config, METH_NOARGS},
{"test_sizeof_c_types", (PyCFunction)test_sizeof_c_types, METH_NOARGS},
{"test_datetime_capi", test_datetime_capi, METH_NOARGS},