mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)
Remove the private undocumented function _PyEval_CallTracing() from the C API. Call the public sys.call_tracing() function instead.
This commit is contained in:
parent
9087243e2c
commit
e63894b3ee
4 changed files with 13 additions and 6 deletions
|
@ -6708,16 +6708,19 @@ call_trace(Py_tracefunc func, PyObject *obj,
|
|||
return result;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
PyObject*
|
||||
_PyEval_CallTracing(PyObject *func, PyObject *args)
|
||||
{
|
||||
// Save and disable tracing
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
int save_tracing = tstate->tracing;
|
||||
int save_use_tracing = tstate->cframe->use_tracing;
|
||||
PyObject *result;
|
||||
|
||||
tstate->tracing = 0;
|
||||
result = PyObject_Call(func, args, NULL);
|
||||
|
||||
// Call the tracing function
|
||||
PyObject *result = PyObject_Call(func, args, NULL);
|
||||
|
||||
// Restore tracing
|
||||
tstate->tracing = save_tracing;
|
||||
tstate->cframe->use_tracing = save_use_tracing;
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue