Skip to content

Commit d88668c

Browse files
authored
Add initial support for PyPy3.12 v8.0.0 (#177)
1 parent c509434 commit d88668c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
=========
33

4+
* 2026-09-22: Add initial support for PyPy3.12 v8.0.0, which provides
5+
``PyFrame_GetCode()`` and ``PyInterpreterState_Get()``.
46
* 2026-09-07: Remove code to support Python 2.7, Python 3.5 and PyPy
57
for Python 2.7 ("pypy2").
68
Python 2.7 was no longer supported since August 2023.

pythoncapi_compat.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size)
126126

127127

128128
// bpo-40421 added PyFrame_GetCode() to Python 3.9.0b1
129-
#if PY_VERSION_HEX < 0x030900B1 || defined(PYPY_VERSION)
129+
// PyPy added PyFrame_GetCode() to PyPy3.12 v8.0.0
130+
#if PY_VERSION_HEX < 0x030900B1 || (defined(PYPY_VERSION) && PY_VERSION_HEX < 0x030C0000)
130131
static inline PyCodeObject* PyFrame_GetCode(PyFrameObject *frame)
131132
{
132133
assert(frame != _Py_NULL);
@@ -285,7 +286,8 @@ _PyThreadState_GetFrameBorrow(PyThreadState *tstate)
285286

286287

287288
// bpo-39947 added PyInterpreterState_Get() to Python 3.9.0a5
288-
#if PY_VERSION_HEX < 0x030900A5 || defined(PYPY_VERSION)
289+
// PyPy added PyInterpreterState_Get() to PyPy3.12 v8.0.0
290+
#if PY_VERSION_HEX < 0x030900A5 || (defined(PYPY_VERSION) && PY_VERSION_HEX < 0x030C0000)
289291
static inline PyInterpreterState* PyInterpreterState_Get(void)
290292
{
291293
PyThreadState *tstate;

0 commit comments

Comments
 (0)