Bug report
Bug description:
The docs for PyModule_AddObjectRef say:
|
Return ``NULL`` if *value* is ``NULL``. It must be called with an exception |
|
raised in this case. |
However the function actually returns -1 in that case:
|
if (!value) { |
|
if (!PyErr_Occurred()) { |
|
PyErr_SetString(PyExc_SystemError, |
|
"PyModule_AddObjectRef() must be called " |
|
"with an exception raised if value is NULL"); |
|
} |
|
return -1; |
|
} |
We should update the documentation to reflect that.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
The docs for
PyModule_AddObjectRefsay:cpython/Doc/c-api/module.rst
Lines 520 to 521 in cae1526
However the function actually returns
-1in that case:cpython/Python/modsupport.c
Lines 590 to 597 in cae1526
We should update the documentation to reflect that.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
PyModule_AddObjectRef#121750PyModule_AddObjectRef(GH-121750) #121752PyModule_AddObjectRef(GH-121750) #121753