Skip to content

Commit 2f7d223

Browse files
authored
Merge pull request #25 from picnixz/patch-1
2 parents 4c3477b + 4f675fd commit 2f7d223

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Doc/c-api/import.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,23 @@ Importing Modules
353353
354354
.. versionadded:: next
355355
356-
.. c:function:: PyObject* PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
356+
.. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
357357
358358
Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
359359
strings instead of Python :class:`str` objects.
360360
361+
This function always returns ``0``.
362+
361363
.. versionadded:: next
362364
363-
.. c:function:: PyObject* PyImport_SetLazyImportsFilter(PyObject *filter)
365+
.. c:function:: int PyImport_SetLazyImportsFilter(PyObject *filter)
366+
367+
Sets the current lazy imports filter. The *filter* should be a callable that
368+
will receive ``(importing_module_name, imported_module_name, [fromlist])``
369+
when an import can potentially be lazy and that must return ``True`` if
370+
the import should be lazy and ``False`` otherwise.
364371
365-
Sets the current lazy imports filter. The function should be a callable that
366-
will receive (importing_module_name, imported_module_name, [fromlist]) when
367-
an import can potentially be lazy. Returns ``True`` if the import should be lazy
368-
or ``False`` otherwise.
372+
Return ``0`` on success and ``-1`` with an exception set otherwise.
369373
370374
.. versionadded:: next
371375

0 commit comments

Comments
 (0)