summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/mathmodule.c.h
diff options
context:
space:
mode:
authorAmmar Askar <ammar_askar@hotmail.com>2019-01-12 06:23:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-01-12 06:23:41 (GMT)
commitcb08a71c5c534f33d9486677534dafb087c30e8c (patch)
tree19b46ba5dda5c870c2a2f8614e19e3831e5f3ec8 /Modules/clinic/mathmodule.c.h
parentfdf282d609fd172d52b59a6f1f062eb701494528 (diff)
downloadcpython-cb08a71c5c534f33d9486677534dafb087c30e8c.zip
cpython-cb08a71c5c534f33d9486677534dafb087c30e8c.tar.gz
cpython-cb08a71c5c534f33d9486677534dafb087c30e8c.tar.bz2
bpo-34838: Use subclass_of for math.dist. (GH-9659)
Argument clinic now generates fast inline code for positional parsing, so the manually implemented type check in math.dist can be removed.
Diffstat (limited to 'Modules/clinic/mathmodule.c.h')
-rw-r--r--Modules/clinic/mathmodule.c.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h
index 1c8fc2f..82a4c4a 100644
--- a/Modules/clinic/mathmodule.c.h
+++ b/Modules/clinic/mathmodule.c.h
@@ -310,7 +310,15 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("dist", nargs, 2, 2)) {
goto exit;
}
+ if (!PyTuple_Check(args[0])) {
+ _PyArg_BadArgument("dist", 1, "tuple", args[0]);
+ goto exit;
+ }
p = args[0];
+ if (!PyTuple_Check(args[1])) {
+ _PyArg_BadArgument("dist", 2, "tuple", args[1]);
+ goto exit;
+ }
q = args[1];
return_value = math_dist_impl(module, p, q);
@@ -548,4 +556,4 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=f3264ab0ef57ba0a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0664f30046da09fe input=a9049054013a1b77]*/