Skip to content

Commit

Permalink
Use v3.12 API in stable ABI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Sep 16, 2024
1 parent 379cafd commit 23dcbab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ PyObject *module_new_submodule(PyObject *base, const char *name,
if (!tmp_str)
goto fail;

#if PY_VERSION_HEX < 0x030D00A0
#if PY_VERSION_HEX < 0x030D00A0 || defined(Py_LIMITED_API)
res = borrow(PyImport_AddModule(tmp_str));
#else
res = steal(PyImport_AddModuleRef(tmp_str));
Expand Down Expand Up @@ -1188,7 +1188,8 @@ void maybe_make_immortal(PyObject *op) {
PyObject *dict_get_item_ref_or_fail(PyObject *d, PyObject *k) {
PyObject *value;
bool error = false;
#if PY_VERSION_HEX < 0x030D00A1

#if PY_VERSION_HEX < 0x030D00A1 || defined(Py_LIMITED_API)
value = PyDict_GetItemWithError(d, k);
if (value)
Py_INCREF(value);
Expand Down

0 comments on commit 23dcbab

Please sign in to comment.