Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3c8916

Browse files
[3.12]gh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227) (GH-107260)
(cherry picked from commit698b015)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent11d86c5 commitc3c8916

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎Include/modsupport.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
3939

4040
PyAPI_FUNC(PyObject*)Py_VaBuildValue(constchar*,va_list);
4141

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

4749
// Similar to PyModule_AddObjectRef() but steal a reference to 'obj'
4850
// (Py_DECREF(obj)) on success (if it returns 0).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:c:func:`PyModule_AddObjectRef` is now only available in the limited API
2+
version 3.10 or later.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp