Skip to content

Commit d334122

Browse files
miss-islingtonpatenaudAlexWaygoodAA-Turner
authored
[3.12] GH-69695: Update PyImport_ImportModule description (GH-103836) GH-114925)
GH-69695: Update ``PyImport_ImportModule`` description (GH-103836) (cherry picked from commit 9872855) Co-authored-by: patenaud <[email protected]> Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent ae7fa9f commit d334122

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Doc/c-api/import.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,8 @@ Importing Modules
1313
single: __all__ (package variable)
1414
single: modules (in module sys)
1515
16-
This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below,
17-
leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set
18-
to 0. When the *name*
19-
argument contains a dot (when it specifies a submodule of a package), the
20-
*fromlist* argument is set to the list ``['*']`` so that the return value is the
21-
named module rather than the top-level package containing it as would otherwise
22-
be the case. (Unfortunately, this has an additional side effect when *name* in
23-
fact specifies a subpackage instead of a submodule: the submodules specified in
24-
the package's ``__all__`` variable are loaded.) Return a new reference to the
25-
imported module, or ``NULL`` with an exception set on failure. A failing
26-
import of a module doesn't leave the module in :data:`sys.modules`.
27-
28-
This function always uses absolute imports.
29-
16+
This is a wrapper around :c:func:`PyImport_Import()` which takes a
17+
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
3018
3119
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
3220

0 commit comments

Comments
 (0)