Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions yappi/_yappi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
Loading