mirror of
https://github.com/python/cpython.git
synced 2025-08-11 04:19:06 +00:00
[3.12] gh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227) (GH-107260)
(cherry picked from commit 698b015135
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
11d86c5c33
commit
c3c8916dea
2 changed files with 4 additions and 0 deletions
|
@ -39,10 +39,12 @@ PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(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 success.
|
||||
// On error, raise an exception and return -1.
|
||||
PyAPI_FUNC(int) PyModule_AddObjectRef(PyObject *mod, const char *name, PyObject *value);
|
||||
#endif /* Py_LIMITED_API */
|
||||
|
||||
// Similar to PyModule_AddObjectRef() but steal a reference to 'obj'
|
||||
// (Py_DECREF(obj)) on success (if it returns 0).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue