diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-11-28 10:59:04 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-11-28 10:59:04 (GMT) |
commit | 048afd98b3d10fe17b4d7ec2e407f27b36b9380c (patch) | |
tree | c34e769ff6a51f4c7973f677fb06374d1e14985f /Python/sysmodule.c | |
parent | 214678e44bf7773c0ed9c3684818354001d8f9ca (diff) | |
download | cpython-048afd98b3d10fe17b4d7ec2e407f27b36b9380c.zip cpython-048afd98b3d10fe17b4d7ec2e407f27b36b9380c.tar.gz cpython-048afd98b3d10fe17b4d7ec2e407f27b36b9380c.tar.bz2 |
Remove CALL_PROFILE special build
Issue #28799:
* Remove the PyEval_GetCallStats() function.
* Deprecate the untested and undocumented sys.callstats() function.
* Remove the CALL_PROFILE special build
Use the sys.setprofile() function, cProfile or profile module to profile
function calls.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index db5a48f..7906830 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1287,6 +1287,19 @@ a 11-tuple where the entries in the tuple are counts of:\n\ 10. Number of stack pops performed by call_function()" ); +static PyObject * +sys_callstats(PyObject *self) +{ + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "sys.callstats() has been deprecated in Python 3.7 " + "and will be removed in the future", 1) < 0) { + return NULL; + } + + Py_RETURN_NONE; +} + + #ifdef __cplusplus extern "C" { #endif @@ -1352,7 +1365,7 @@ Return True if Python is exiting."); static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ - {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, + {"callstats", (PyCFunction)sys_callstats, METH_NOARGS, callstats_doc}, {"_clear_type_cache", sys_clear_type_cache, METH_NOARGS, sys_clear_type_cache__doc__}, |