summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorMohamed Koubaa <koubaa.m@gmail.com>2020-09-23 10:33:21 (GMT)
committerGitHub <noreply@github.com>2020-09-23 10:33:21 (GMT)
commit83de110dce94a9196dccc01d526628615714e362 (patch)
treee018ea13563651069e9f2ef2dbd8a5044630b559 /Modules/clinic
parent438e9fc66f664eff0526a16a6d900349bfd1f9d2 (diff)
downloadcpython-83de110dce94a9196dccc01d526628615714e362.zip
cpython-83de110dce94a9196dccc01d526628615714e362.tar.gz
cpython-83de110dce94a9196dccc01d526628615714e362.tar.bz2
bpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (GH-22220)
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/_lsprof.c.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/Modules/clinic/_lsprof.c.h b/Modules/clinic/_lsprof.c.h
index 50762e3..5d9c209 100644
--- a/Modules/clinic/_lsprof.c.h
+++ b/Modules/clinic/_lsprof.c.h
@@ -31,14 +31,25 @@ PyDoc_STRVAR(_lsprof_Profiler_getstats__doc__,
" inlinetime inline time (not in further subcalls)");
#define _LSPROF_PROFILER_GETSTATS_METHODDEF \
- {"getstats", (PyCFunction)_lsprof_Profiler_getstats, METH_NOARGS, _lsprof_Profiler_getstats__doc__},
+ {"getstats", (PyCFunction)(void(*)(void))_lsprof_Profiler_getstats, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _lsprof_Profiler_getstats__doc__},
static PyObject *
-_lsprof_Profiler_getstats_impl(ProfilerObject *self);
+_lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls);
static PyObject *
-_lsprof_Profiler_getstats(ProfilerObject *self, PyObject *Py_UNUSED(ignored))
+_lsprof_Profiler_getstats(ProfilerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
- return _lsprof_Profiler_getstats_impl(self);
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = { NULL};
+ static _PyArg_Parser _parser = {":getstats", _keywords, 0};
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser
+ )) {
+ goto exit;
+ }
+ return_value = _lsprof_Profiler_getstats_impl(self, cls);
+
+exit:
+ return return_value;
}
-/*[clinic end generated code: output=24c525812713e00f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b4727cfebecdd22d input=a9049054013a1b77]*/