mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
document return value for PyImport_GetLazyImportsFilter
This commit is contained in:
parent
b5121b0e59
commit
093f08b8ab
3 changed files with 6 additions and 2 deletions
|
|
@ -349,7 +349,8 @@ Importing Modules
|
|||
|
||||
.. c:function:: PyObject* PyImport_GetLazyImportsFilter()
|
||||
|
||||
Gets the current lazy imports filter. Returns a :term:`strong reference`.
|
||||
Return a :term:`strong reference` to the current lazy imports filter,
|
||||
or ``NULL`` if none exists. This function always succeeds.
|
||||
|
||||
.. versionadded:: next
|
||||
|
||||
|
|
|
|||
|
|
@ -4802,7 +4802,9 @@ PyImport_SetLazyImportsFilter(PyObject *filter)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Gets the lazy imports filter. Returns a new reference. */
|
||||
/* Return a strong reference to the current lazy imports filter
|
||||
* or NULL if none exists. This function always succeeds.
|
||||
*/
|
||||
PyObject *
|
||||
PyImport_GetLazyImportsFilter(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2815,6 +2815,7 @@ sys_get_lazy_imports_filter_impl(PyObject *module)
|
|||
{
|
||||
PyObject *filter = PyImport_GetLazyImportsFilter();
|
||||
if (filter == NULL) {
|
||||
assert(!PyErr_Occurred());
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return filter;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue