From d1bf9e9afa75a035798829fdbf1e26e49dd328ae Mon Sep 17 00:00:00 2001 From: patenaud Date: Tue, 25 Apr 2023 11:00:56 -0400 Subject: [PATCH 1/2] doc: update import.rst PyImport_ImportModule description #69695 --- Doc/c-api/import.rst | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index a51619db6d3d97..e72fd84bbfacd1 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -13,19 +13,7 @@ Importing Modules single: __all__ (package variable) single: modules (in module sys) - This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below, - leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set - to 0. When the *name* - argument contains a dot (when it specifies a submodule of a package), the - *fromlist* argument is set to the list ``['*']`` so that the return value is the - named module rather than the top-level package containing it as would otherwise - be the case. (Unfortunately, this has an additional side effect when *name* in - fact specifies a subpackage instead of a submodule: the submodules specified in - the package's ``__all__`` variable are loaded.) Return a new reference to the - imported module, or ``NULL`` with an exception set on failure. A failing - import of a module doesn't leave the module in :data:`sys.modules`. - - This function always uses absolute imports. + This is a wrapper around :c:func:`PyImport_Import()` which takes a ``const char *`` as an argument instead of a ``PyObject *``. .. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name) From de518b65d446c8d6bd1f047867b0cb880805bcf2 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 24 Jan 2024 15:13:29 +0100 Subject: [PATCH 2/2] Apply suggestions from review Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/c-api/import.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index e72fd84bbfacd1..a2f4f88198bb22 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -13,8 +13,8 @@ Importing Modules single: __all__ (package variable) single: modules (in module sys) - This is a wrapper around :c:func:`PyImport_Import()` which takes a ``const char *`` as an argument instead of a ``PyObject *``. - + This is a wrapper around :c:func:`PyImport_Import()` which takes a + :c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`. .. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)