Skip to content

Commit

Permalink
pythongh-107226: PyModule_AddObjectRef() should only be in the limite…
Browse files Browse the repository at this point in the history
…d API 3.10
  • Loading branch information
serhiy-storchaka committed Jul 25, 2023
1 parent f443b54 commit a7d7a47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Include/modsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
// Add an attribute with name 'name' and value 'obj' to the module 'mod.
// On success, return 0.
// On error, raise an exception and return -1.
PyAPI_FUNC(int) PyModule_AddObjectRef(PyObject *mod, const char *name, PyObject *value);
#endif /* Py_LIMITED_API */

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
// Similar to PyModule_AddObjectRef() but steal a reference to 'value'.
Expand Down

0 comments on commit a7d7a47

Please sign in to comment.