mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636)
Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE have already been
fixed by commit 9258f3da91 (issue gh-134989).
This commit is contained in:
parent
18e4a89e42
commit
c636477523
2 changed files with 9 additions and 2 deletions
|
|
@ -695,8 +695,13 @@ PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
|
|||
# define Py_NotImplemented (&_Py_NotImplementedStruct)
|
||||
#endif
|
||||
|
||||
/* Macro for returning Py_NotImplemented from a function */
|
||||
#define Py_RETURN_NOTIMPLEMENTED return Py_NotImplemented
|
||||
/* Macro for returning Py_NotImplemented from a function. Only treat
|
||||
* Py_NotImplemented as immortal in the limited C API 3.12 and newer. */
|
||||
#if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030c0000
|
||||
# define Py_RETURN_NOTIMPLEMENTED return Py_NewRef(Py_NotImplemented)
|
||||
#else
|
||||
# define Py_RETURN_NOTIMPLEMENTED return Py_NotImplemented
|
||||
#endif
|
||||
|
||||
/* Rich comparison opcodes */
|
||||
#define Py_LT 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue