This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Mark.Shannon, Xtrem532, erlendaasland, gvanrossum, hroncok, jpe, lukasz.langa, miss-islington, pablogsal, petr.viktorin, rhettinger, scoder, vstinner
Date 2021-11-08.17:16:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636391797.22.0.318696130262.issue43760@roundup.psfhosted.org>
In-reply-to
Content
greenlet now uses PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() rather than accessing directly use_tracing:

https://github.com/python-greenlet/greenlet/commit/9b49da5c7e4808bd61b992e40f5b5243bfa9be6f

On Python 3.10, it implements these functions with:
---

// bpo-43760 added PyThreadState_EnterTracing() to Python 3.11.0a2
#if PY_VERSION_HEX < 0x030B00A2 && !defined(PYPY_VERSION)
static inline void PyThreadState_EnterTracing(PyThreadState *tstate)
{
    tstate->tracing++;
#if PY_VERSION_HEX >= 0x030A00A1
    tstate->cframe->use_tracing = 0;
#else
    tstate->use_tracing = 0;
#endif
}
#endif

// bpo-43760 added PyThreadState_LeaveTracing() to Python 3.11.0a2
#if PY_VERSION_HEX < 0x030B00A2 && !defined(PYPY_VERSION)
static inline void PyThreadState_LeaveTracing(PyThreadState *tstate)
{
    tstate->tracing--;
    int use_tracing = (tstate->c_tracefunc != NULL
                       || tstate->c_profilefunc != NULL);
#if PY_VERSION_HEX >= 0x030A00A1
    tstate->cframe->use_tracing = use_tracing;
#else
    tstate->use_tracing = use_tracing;
#endif
}
#endif
---

This code was copied from my https://github.com/pythoncapi/pythoncapi_compat project. (I wrote the greenlet change.)
History
Date User Action Args
2021-11-08 17:16:37vstinnersetrecipients: + vstinner, gvanrossum, rhettinger, jpe, scoder, petr.viktorin, lukasz.langa, Mark.Shannon, hroncok, pablogsal, miss-islington, erlendaasland, Xtrem532
2021-11-08 17:16:37vstinnersetmessageid: <1636391797.22.0.318696130262.issue43760@roundup.psfhosted.org>
2021-11-08 17:16:37vstinnerlinkissue43760 messages
2021-11-08 17:16:37vstinnercreate