]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-97841: Add methoddef for _filters_mutated (gh-98115)
authorDong-hee Na <donghee.na@python.org>
Sun, 9 Oct 2022 11:16:33 +0000 (20:16 +0900)
committerGitHub <noreply@github.com>
Sun, 9 Oct 2022 11:16:33 +0000 (20:16 +0900)
Python/_warnings.c
Python/clinic/_warnings.c.h

index 0d4c50f769b03c67489d65bf8f56be54cd47e6c7..b46fbdca9db38c62a10fe5e5ecba577b5d11a3c2 100644 (file)
@@ -1086,8 +1086,14 @@ warnings_warn_explicit_impl(PyObject *module, PyObject *message,
     return returned;
 }
 
+/*[clinic input]
+_filters_mutated as warnings_filters_mutated
+
+[clinic start generated code]*/
+
 static PyObject *
-warnings_filters_mutated(PyObject *self, PyObject *Py_UNUSED(args))
+warnings_filters_mutated_impl(PyObject *module)
+/*[clinic end generated code: output=8ce517abd12b88f4 input=35ecbf08ee2491b2]*/
 {
     PyInterpreterState *interp = get_current_interp();
     if (interp == NULL) {
@@ -1344,8 +1350,7 @@ _PyErr_WarnUnawaitedCoroutine(PyObject *coro)
 static PyMethodDef warnings_functions[] = {
     WARNINGS_WARN_METHODDEF
     WARNINGS_WARN_EXPLICIT_METHODDEF
-    {"_filters_mutated", _PyCFunction_CAST(warnings_filters_mutated), METH_NOARGS,
-        NULL},
+    WARNINGS_FILTERS_MUTATED_METHODDEF
     /* XXX(brett.cannon): add showwarning? */
     /* XXX(brett.cannon): Reasonable to add formatwarning? */
     {NULL, NULL}                /* sentinel */
index 13ebbf45b8e1683fa84105204da5a2e58c7b54ce..8838a42afc1c2aba8f28f60c368b1f199f0da879 100644 (file)
@@ -199,4 +199,21 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=2eac4fabc87a4d56 input=a9049054013a1b77]*/
+
+PyDoc_STRVAR(warnings_filters_mutated__doc__,
+"_filters_mutated($module, /)\n"
+"--\n"
+"\n");
+
+#define WARNINGS_FILTERS_MUTATED_METHODDEF    \
+    {"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS, warnings_filters_mutated__doc__},
+
+static PyObject *
+warnings_filters_mutated_impl(PyObject *module);
+
+static PyObject *
+warnings_filters_mutated(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+    return warnings_filters_mutated_impl(module);
+}
+/*[clinic end generated code: output=0d264d1ddfc37100 input=a9049054013a1b77]*/