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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.7"]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-beta.1"]
# Recall the macOS builds upload built wheels so all supported versions
# need to run on mac.
os: [ubuntu-latest, macos-latest]
Expand Down
4 changes: 3 additions & 1 deletion src/greenlet/TGreenlet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ namespace greenlet
_PyCFrame* cframe;
int use_tracing;
#endif
#if GREENLET_PY312
#if GREENLET_PY314
int py_recursion_depth;
#elif GREENLET_PY312
int py_recursion_depth;
int c_recursion_depth;
#else
Expand Down
17 changes: 13 additions & 4 deletions src/greenlet/TPythonState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ PythonState::PythonState()
,cframe(nullptr)
,use_tracing(0)
#endif
#if GREENLET_PY312
#if GREENLET_PY314
,py_recursion_depth(0)
#elif GREENLET_PY312
,py_recursion_depth(0)
,c_recursion_depth(0)
#else
Expand Down Expand Up @@ -132,7 +134,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
#endif
#endif // GREENLET_USE_CFRAME
#if GREENLET_PY311
#if GREENLET_PY312
#if GREENLET_PY314
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
#elif GREENLET_PY312
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
this->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
#else // not 312
Expand Down Expand Up @@ -207,7 +211,10 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
#endif
#endif // GREENLET_USE_CFRAME
#if GREENLET_PY311
#if GREENLET_PY312
#if GREENLET_PY314
tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth;
this->unexpose_frames();
#elif GREENLET_PY312
tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth;
tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this->c_recursion_depth;
this->unexpose_frames();
Expand Down Expand Up @@ -253,7 +260,9 @@ inline void PythonState::will_switch_from(PyThreadState *const origin_tstate) no
void PythonState::set_initial_state(const PyThreadState* const tstate) noexcept
{
this->_top_frame = nullptr;
#if GREENLET_PY312
#if GREENLET_PY314
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
#elif GREENLET_PY312
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
// XXX: TODO: Comment from a reviewer:
// Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
Expand Down