diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73174d1..7d38bf7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,10 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] - exclude: - - os: macos-latest - python-version: 3.7 + python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/yappi/_yappi.c b/yappi/_yappi.c index 4fd0b20..ceee863 100644 --- a/yappi/_yappi.c +++ b/yappi/_yappi.c @@ -13,11 +13,12 @@ #error "Yappi requires long longs!" #endif -#if PY_VERSION_HEX >= 0x030E0000 // Python 3.14+ +#if PY_VERSION_HEX >= 0x030B0000 // Python 3.11+ #ifndef Py_BUILD_CORE #define Py_BUILD_CORE #endif #include "internal/pycore_genobject.h" + #include "internal/pycore_frame.h" #endif #include "bytesobject.h" #include "frameobject.h" @@ -225,10 +226,11 @@ IS_SUSPENDED(PyFrameObject *frame) { return 0; } - // -1 is FRAME_SUSPENDED. See internal/pycore_frame.h - // TODO: Remove these after 3.12 make necessary public APIs. - // See https://discuss.python.org/t/python-3-11-frame-structure-and-various-changes/17895 - return gen->gi_frame_state == -1; +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 13 + return FRAME_STATE_SUSPENDED(gen->gi_frame_state); +#else + return gen->gi_frame_state == FRAME_SUSPENDED; +#endif #elif PY_VERSION_HEX >= 0x030A0000 // Python 3.10+ return (frame->f_state == FRAME_SUSPENDED); #else