Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4 Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ PyAPI_FUNC(void) _PyThreadState_DeleteExcept(
PyThreadState *tstate);

static inline void
_PyThreadState_DisableTracing(PyThreadState *tstate)
_PyThreadState_PauseTracing(PyThreadState *tstate)
{
tstate->cframe->use_tracing = 0;
}

static inline void
_PyThreadState_ResetTracing(PyThreadState *tstate)
_PyThreadState_ResumeTracing(PyThreadState *tstate)
{
int use_tracing = (tstate->c_tracefunc != NULL
|| tstate->c_profilefunc != NULL);
Expand Down
14 changes: 7 additions & 7 deletions 14 Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -6165,7 +6165,7 @@ call_trace(Py_tracefunc func, PyObject *obj,
if (tstate->tracing)
return 0;
tstate->tracing++;
_PyThreadState_DisableTracing(tstate);
_PyThreadState_PauseTracing(tstate);
PyFrameObject *f = _PyFrame_GetFrameObject(frame);
if (f == NULL) {
return -1;
Expand All @@ -6179,7 +6179,7 @@ call_trace(Py_tracefunc func, PyObject *obj,
}
result = func(obj, f, what, arg);
f->f_lineno = 0;
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
tstate->tracing--;
return result;
}
Expand All @@ -6193,7 +6193,7 @@ _PyEval_CallTracing(PyObject *func, PyObject *args)
PyObject *result;

tstate->tracing = 0;
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
result = PyObject_Call(func, args, NULL);
tstate->tracing = save_tracing;
tstate->cframe->use_tracing = save_use_tracing;
Expand Down Expand Up @@ -6250,15 +6250,15 @@ _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
tstate->c_profilefunc = NULL;
tstate->c_profileobj = NULL;
/* Must make sure that tracing is not ignored if 'profileobj' is freed */
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
Py_XDECREF(profileobj);

Py_XINCREF(arg);
tstate->c_profileobj = arg;
tstate->c_profilefunc = func;

/* Flag that tracing or profiling is turned on */
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
return 0;
}

Expand Down Expand Up @@ -6291,15 +6291,15 @@ _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
tstate->c_tracefunc = NULL;
tstate->c_traceobj = NULL;
/* Must make sure that profiling is not ignored if 'traceobj' is freed */
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
Py_XDECREF(traceobj);

Py_XINCREF(arg);
tstate->c_traceobj = arg;
tstate->c_tracefunc = func;

/* Flag that tracing or profiling is turned on */
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions 4 Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,14 +1205,14 @@ void
PyThreadState_EnterTracing(PyThreadState *tstate)
{
tstate->tracing++;
_PyThreadState_DisableTracing(tstate);
_PyThreadState_PauseTracing(tstate);
}

void
PyThreadState_LeaveTracing(PyThreadState *tstate)
{
tstate->tracing--;
_PyThreadState_ResetTracing(tstate);
_PyThreadState_ResumeTracing(tstate);
}


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.