From 3889b052b60ea4e7cdcd36c6f7c0c326509e502a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 14 Nov 2023 14:58:42 +0100 Subject: [PATCH] Fix Python 3.13.0a1 --- pythoncapi_compat.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pythoncapi_compat.h b/pythoncapi_compat.h index da9f794..4a3f733 100644 --- a/pythoncapi_compat.h +++ b/pythoncapi_compat.h @@ -1043,10 +1043,11 @@ PyDict_Pop(PyObject *dict, PyObject *key, PyObject **result) return -1; } - // bpo-16991 added _PyDict_Pop() to Python 3.5.0b2 -#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x030500b2 + // bpo-16991 added _PyDict_Pop() to Python 3.5.0b2. + // Python 3.6.0b3 changed _PyDict_Pop() first argument type to PyObject*. + // Python 3.13.0a1 removed _PyDict_Pop(). +#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x030500b2 || PY_VERSION_HEX >= 0x030D0000 value = PyObject_CallMethod(dict, "pop", "O", key); - // Python 3.6.0b3 changed _PyDict_Pop() first argument type to PyObject* #elif PY_VERSION_HEX < 0x030600b3 value = _PyDict_Pop(_Py_CAST(PyDictObject*, dict), key, NULL); #else