aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/legacy_tracing.c
diff options
context:
space:
mode:
authorPeter Bierma <zintensitydev@gmail.com>2025-01-20 06:34:35 -0500
committerGitHub <noreply@github.com>2025-01-20 17:04:35 +0530
commit4d0a6595a06c554c57ebd90ee64ff4c2bec239b8 (patch)
treea44951c47b86cbc327cdd5e1a588b467dc758a36 /Python/legacy_tracing.c
parentc6b570e5e3b214d2038645c5fa7806e0fb3f7dcd (diff)
downloadcpython-4d0a6595a06c554c57ebd90ee64ff4c2bec239b8.tar.gz
cpython-4d0a6595a06c554c57ebd90ee64ff4c2bec239b8.zip
gh-128360: Add `_Py_AssertHoldsTstate` as assertion for holding a thread state (#128361)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Diffstat (limited to 'Python/legacy_tracing.c')
-rw-r--r--Python/legacy_tracing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/legacy_tracing.c b/Python/legacy_tracing.c
index 45af275f1f6..97634f9183c 100644
--- a/Python/legacy_tracing.c
+++ b/Python/legacy_tracing.c
@@ -491,8 +491,8 @@ int
_PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
{
assert(is_tstate_valid(tstate));
- /* The caller must hold the GIL */
- assert(PyGILState_Check());
+ /* The caller must hold a thread state */
+ _Py_AssertHoldsTstate();
/* Call _PySys_Audit() in the context of the current thread state,
even if tstate is not the current thread state. */
@@ -586,8 +586,8 @@ int
_PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
{
assert(is_tstate_valid(tstate));
- /* The caller must hold the GIL */
- assert(PyGILState_Check());
+ /* The caller must hold a thread state */
+ _Py_AssertHoldsTstate();
/* Call _PySys_Audit() in the context of the current thread state,
even if tstate is not the current thread state. */