summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_pystate.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_pystate.h')
-rw-r--r--Include/internal/pycore_pystate.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index b4a39b62b7..51d119c23e 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -131,8 +131,9 @@ PyAPI_FUNC(void) _PyThreadState_DeleteExcept(
static inline void
_PyThreadState_UpdateTracingState(PyThreadState *tstate)
{
- int use_tracing = (tstate->c_tracefunc != NULL
- || tstate->c_profilefunc != NULL);
+ bool use_tracing =
+ (tstate->tracing == 0) &&
+ (tstate->c_tracefunc != NULL || tstate->c_profilefunc != NULL);
tstate->cframe->use_tracing = (use_tracing ? 255 : 0);
}