Skip to content

Commit e0c2c0a

Browse files
committed
Fix PyPy
1 parent d574056 commit e0c2c0a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Python 3.13
7272
Return non-zero if the Python interpreter is shutting down, return 0
7373
otherwise.
7474
75-
Availability: Python 3.3 and newer.
75+
Availability: Python 3.3 and newer, PyPy 7.3 and newer.
7676
7777
See `Py_IsFinalizing() documentation <https://docs.python.org/dev/c-api/init.html#c.Py_IsFinalizing>`__.
7878

pythoncapi_compat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ PyModule_Add(PyObject *mod, const char *name, PyObject *value)
847847

848848

849849
// gh-108014 added Py_IsFinalizing() to Python 3.13.0a1
850+
// Py_IsFinalizing() was added to PyPy 7.3.0.
850851
// bpo-1856 added _Py_Finalizing to Python 3.2.1b1.
851852
#if PY_VERSION_HEX < 0x030D00A1 && PY_VERSION_HEX >= 0x030201B1
852853
PYCAPI_COMPAT_STATIC_INLINE(int)

tests/test_pythoncapi_compat_cext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ test_interpreter(PyObject *Py_UNUSED(module), PyObject* Py_UNUSED(ignored))
328328
PyInterpreterState *interp2 = PyThreadState_GetInterpreter(tstate);
329329
assert(interp == interp2);
330330

331-
#if 0x030300A1 <= PY_VERSION_HEX
331+
#if 0x030300A1 <= PY_VERSION_HEX && (!defined(PYPY_VERSION_NUM) || PYPY_VERSION_NUM >= 0x7030000)
332332
// test Py_IsFinalizing()
333333
assert(Py_IsFinalizing() == 0);
334334
#endif

0 commit comments

Comments
 (0)