Skip to content

Commit

Permalink
Add support for python 3.13
Browse files Browse the repository at this point in the history
_PyEval_SetProfile() has been moved to internal pycore_ceval.h and it is
not longer exported [1]. PyEval_SetProfileAllThreads was introduced in 3.12 [2].

[1] python/cpython@c494fb3
[2] https://github.com/python/cpython/commits/76af5c9153394f3d07562427168711a68f54ec66
  • Loading branch information
amoralej committed Jul 2, 2024
1 parent 942160f commit defc029
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yappi/_yappi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,9 @@ _resume_greenlet_ctx(_ctx *ctx)
static void
_eval_setprofile(PyThreadState *ts)
{
#if PY_VERSION_HEX > 0x030b0000
#if PY_VERSION_HEX > 0x030c0000
PyEval_SetProfileAllThreads(_yapp_callback, NULL);
#elif PY_VERSION_HEX > 0x030b0000
_PyEval_SetProfile(ts, _yapp_callback, NULL);
#elif PY_VERSION_HEX < 0x030a00b1
ts->use_tracing = 1;
Expand All @@ -1298,7 +1300,9 @@ _eval_setprofile(PyThreadState *ts)
static void
_eval_unsetprofile(PyThreadState *ts)
{
#if PY_VERSION_HEX > 0x030b0000
#if PY_VERSION_HEX > 0x030c0000
PyEval_SetProfileAllThreads(NULL, NULL);
#elif PY_VERSION_HEX > 0x030b0000
_PyEval_SetProfile(ts, NULL, NULL);
#elif PY_VERSION_HEX < 0x030a00b1
ts->use_tracing = 0;
Expand Down

0 comments on commit defc029

Please # to comment.