diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-11-20 18:45:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 18:45:40 (GMT) |
commit | b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2 (patch) | |
tree | 09da38a72eed675d16e3f315c388bcdad7c3dec9 /Modules/_testcapimodule.c | |
parent | 3ec0f495163da3b7a15deb2805cec48aed432f58 (diff) | |
download | cpython-b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2.zip cpython-b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2.tar.gz cpython-b1dede3ee3498100b95265f7fdb0ea2bef9a2ba2.tar.bz2 |
bpo-25750: Fix a compiler warning introduced in GH-9084. (GH-10234)
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 56a08a4..0dc4d7a 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4586,18 +4586,18 @@ new_hamt(PyObject *self, PyObject *args) static PyObject* bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { - if (nargs != 3) { - PyErr_SetString(PyExc_TypeError, "bad_get requires exactly 3 arguments"); + PyObject *self, *obj, *cls; + if (!_PyArg_UnpackStack(args, nargs, "bad_get", 3, 3, &self, &obj, &cls)) { return NULL; } - PyObject *res = PyObject_CallObject(args[2], NULL); + PyObject *res = PyObject_CallObject(cls, NULL); if (res == NULL) { return NULL; } Py_DECREF(res); - return PyObject_Repr(args[0]); + return PyObject_Repr(self); } @@ -4960,7 +4960,7 @@ static PyMethodDef TestMethods[] = { {"get_mapping_items", get_mapping_items, METH_O}, {"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS}, {"hamt", new_hamt, METH_NOARGS}, - {"bad_get", bad_get, METH_FASTCALL}, + {"bad_get", (PyCFunction)bad_get, METH_FASTCALL}, {"EncodeLocaleEx", encode_locale_ex, METH_VARARGS}, {"DecodeLocaleEx", decode_locale_ex, METH_VARARGS}, {"get_global_config", get_global_config, METH_NOARGS}, |