Skip to content

Commit

Permalink
Fix Python 3.13.0a1
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Nov 14, 2023
1 parent 87cf8e6 commit 3889b05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pythoncapi_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3889b05

Please sign in to comment.