Skip to content

Commit 228dd59

Browse files
authored
Merge pull request #445 from vstinner/python314b1
Update to Python 3.14 beta 1
2 parents 9195828 + a2f98dc commit 228dd59

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ${{ matrix.os }}
2323
strategy:
2424
matrix:
25-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.7"]
25+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14.0-beta.1"]
2626
# Recall the macOS builds upload built wheels so all supported versions
2727
# need to run on mac.
2828
os: [ubuntu-latest, macos-latest]

src/greenlet/TGreenlet.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ namespace greenlet
110110
_PyCFrame* cframe;
111111
int use_tracing;
112112
#endif
113-
#if GREENLET_PY312
113+
#if GREENLET_PY314
114+
int py_recursion_depth;
115+
#elif GREENLET_PY312
114116
int py_recursion_depth;
115117
int c_recursion_depth;
116118
#else

src/greenlet/TPythonState.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ PythonState::PythonState()
1212
,cframe(nullptr)
1313
,use_tracing(0)
1414
#endif
15-
#if GREENLET_PY312
15+
#if GREENLET_PY314
16+
,py_recursion_depth(0)
17+
#elif GREENLET_PY312
1618
,py_recursion_depth(0)
1719
,c_recursion_depth(0)
1820
#else
@@ -132,7 +134,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
132134
#endif
133135
#endif // GREENLET_USE_CFRAME
134136
#if GREENLET_PY311
135-
#if GREENLET_PY312
137+
#if GREENLET_PY314
138+
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
139+
#elif GREENLET_PY312
136140
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
137141
this->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
138142
#else // not 312
@@ -207,7 +211,10 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
207211
#endif
208212
#endif // GREENLET_USE_CFRAME
209213
#if GREENLET_PY311
210-
#if GREENLET_PY312
214+
#if GREENLET_PY314
215+
tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth;
216+
this->unexpose_frames();
217+
#elif GREENLET_PY312
211218
tstate->py_recursion_remaining = tstate->py_recursion_limit - this->py_recursion_depth;
212219
tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this->c_recursion_depth;
213220
this->unexpose_frames();
@@ -253,7 +260,9 @@ inline void PythonState::will_switch_from(PyThreadState *const origin_tstate) no
253260
void PythonState::set_initial_state(const PyThreadState* const tstate) noexcept
254261
{
255262
this->_top_frame = nullptr;
256-
#if GREENLET_PY312
263+
#if GREENLET_PY314
264+
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
265+
#elif GREENLET_PY312
257266
this->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining;
258267
// XXX: TODO: Comment from a reviewer:
259268
// Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``?

0 commit comments

Comments
 (0)