summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-16 09:55:32 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-16 09:55:32 +0300
commite6a7bcca64e6e411df577454048decd56ec493a0 (patch)
treeae9c39a9413ebf311ae0d0cbdee38b82f68b8f1d /Modules
parent0908ca35175020f601b2875cdc31b36cafcd19f0 (diff)
downloadcpython-e6a7bcca64e6e411df577454048decd56ec493a0.tar.gz
Backported tests for issue #18531.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testcapimodule.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 71aa4198a1..19fea201ce 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -872,6 +872,26 @@ test_L_code(PyObject *self)
#endif /* ifdef HAVE_LONG_LONG */
+static PyObject *
+get_args(PyObject *self, PyObject *args)
+{
+ if (args == NULL) {
+ args = Py_None;
+ }
+ Py_INCREF(args);
+ return args;
+}
+
+static PyObject *
+get_kwargs(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ if (kwargs == NULL) {
+ kwargs = Py_None;
+ }
+ Py_INCREF(kwargs);
+ return kwargs;
+}
+
/* Test tuple argument processing */
static PyObject *
getargs_tuple(PyObject *self, PyObject *args)
@@ -3651,6 +3671,8 @@ static PyMethodDef TestMethods[] = {
{"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS},
#endif
{"getbuffer_with_null_view", getbuffer_with_null_view, METH_O},
+ {"get_args", get_args, METH_VARARGS},
+ {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS},
{"getargs_tuple", getargs_tuple, METH_VARARGS},
{"getargs_keywords", (PyCFunction)getargs_keywords,
METH_VARARGS|METH_KEYWORDS},