summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_pickle.c.h
diff options
context:
space:
mode:
authorSylvain <sylvain.desodt+github@gmail.com>2017-06-10 04:51:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-06-10 04:51:48 (GMT)
commit7445381c606faf20e253da42656db478a4349f8e (patch)
tree49ad79e5347454d1bbfeb1c2d06d3d09fd9b273f /Modules/clinic/_pickle.c.h
parente5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3 (diff)
downloadcpython-7445381c606faf20e253da42656db478a4349f8e.zip
cpython-7445381c606faf20e253da42656db478a4349f8e.tar.gz
cpython-7445381c606faf20e253da42656db478a4349f8e.tar.bz2
bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)
The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
Diffstat (limited to 'Modules/clinic/_pickle.c.h')
-rw-r--r--Modules/clinic/_pickle.c.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h
index e10730a..923961d 100644
--- a/Modules/clinic/_pickle.c.h
+++ b/Modules/clinic/_pickle.c.h
@@ -213,13 +213,13 @@ _pickle_Unpickler_find_class(UnpicklerObject *self, PyObject **args, Py_ssize_t
PyObject *module_name;
PyObject *global_name;
- if (!_PyArg_UnpackStack(args, nargs, "find_class",
- 2, 2,
- &module_name, &global_name)) {
+ if (!_PyArg_NoStackKeywords("find_class", kwnames)) {
goto exit;
}
- if (!_PyArg_NoStackKeywords("find_class", kwnames)) {
+ if (!_PyArg_UnpackStack(args, nargs, "find_class",
+ 2, 2,
+ &module_name, &global_name)) {
goto exit;
}
return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
@@ -564,4 +564,4 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
exit:
return return_value;
}
-/*[clinic end generated code: output=b921d325b2f7a096 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=639dd0eb8de16c3c input=a9049054013a1b77]*/