From 53307e0d32bc71784443e050d4e7e2dc730e87ed Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 16 Jun 2016 17:21:52 +0200 Subject: [PATCH 1/2] clinic: Switch the module argument to PyObject* The module object, not a PyModuleDef*, is passed as the first argument. Also, fix up forward declarations in the cmath module --- Modules/cmathmodule.c | 12 ++++++------ Tools/clinic/clinic.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 82ea589..727d1af 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -82,12 +82,12 @@ else { #define CM_SCALE_DOWN (-(CM_SCALE_UP+1)/2) /* forward declarations */ -static Py_complex cmath_asinh_impl(PyModuleDef *, Py_complex); -static Py_complex cmath_atanh_impl(PyModuleDef *, Py_complex); -static Py_complex cmath_cosh_impl(PyModuleDef *, Py_complex); -static Py_complex cmath_sinh_impl(PyModuleDef *, Py_complex); -static Py_complex cmath_sqrt_impl(PyModuleDef *, Py_complex); -static Py_complex cmath_tanh_impl(PyModuleDef *, Py_complex); +static Py_complex cmath_asinh_impl(PyObject *, Py_complex); +static Py_complex cmath_atanh_impl(PyObject *, Py_complex); +static Py_complex cmath_cosh_impl(PyObject *, Py_complex); +static Py_complex cmath_sinh_impl(PyObject *, Py_complex); +static Py_complex cmath_sqrt_impl(PyObject *, Py_complex); +static Py_complex cmath_tanh_impl(PyObject *, Py_complex); static PyObject * math_error(void); /* Code to deal with special values (infinities, NaNs, etc.). */ diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index c964093..f9ba16c 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2804,7 +2804,7 @@ def correct_name_for_self(f): if f.kind in (CALLABLE, METHOD_INIT): if f.cls: return "PyObject *", "self" - return "PyModuleDef *", "module" + return "PyObject *", "module" if f.kind == STATIC_METHOD: return "void *", "null" if f.kind in (CLASS_METHOD, METHOD_NEW): -- 2.5.5