summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2017-10-08 08:17:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-10-08 08:17:46 (GMT)
commit0ccc0f6c7495be9043300e22d8f38e6d65e8884f (patch)
tree0e93d02086fb4997860e82ca68969a5cfbe24a2f /Modules
parentf07e2b64df6304a36fb5e29397d3c77a7ba17704 (diff)
downloadcpython-0ccc0f6c7495be9043300e22d8f38e6d65e8884f.zip
cpython-0ccc0f6c7495be9043300e22d8f38e6d65e8884f.tar.gz
cpython-0ccc0f6c7495be9043300e22d8f38e6d65e8884f.tar.bz2
bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (#3840)
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 b512c05..6e31105 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4307,6 +4307,25 @@ py_w_stopcode(PyObject *self, PyObject *args)
static PyObject *
+get_mapping_keys(PyObject* self, PyObject *obj)
+{
+ return PyMapping_Keys(obj);
+}
+
+static PyObject *
+get_mapping_values(PyObject* self, PyObject *obj)
+{
+ return PyMapping_Values(obj);
+}
+
+static PyObject *
+get_mapping_items(PyObject* self, PyObject *obj)
+{
+ return PyMapping_Items(obj);
+}
+
+
+static PyObject *
test_pythread_tss_key_state(PyObject *self, PyObject *args)
{
Py_tss_t tss_key = Py_tss_NEEDS_INIT;
@@ -4573,6 +4592,9 @@ static PyMethodDef TestMethods[] = {
#ifdef W_STOPCODE
{"W_STOPCODE", py_w_stopcode, METH_VARARGS},
#endif
+ {"get_mapping_keys", get_mapping_keys, METH_O},
+ {"get_mapping_values", get_mapping_values, METH_O},
+ {"get_mapping_items", get_mapping_items, METH_O},
{"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS},
{NULL, NULL} /* sentinel */
};