mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Clarify that PyImport_AddModule() and PyImport_ExecCodeModule() don't
add any package support structure even if a dotted-name is passed for the module. Closes SF bug #424106.
This commit is contained in:
parent
5c4cf1587b
commit
674dae245a
1 changed files with 7 additions and 3 deletions
|
|
@ -148,10 +148,12 @@ values from C values.
|
||||||
\var{name} argument may be of the form \code{package.module}).
|
\var{name} argument may be of the form \code{package.module}).
|
||||||
First check the modules dictionary if there's one there, and if not,
|
First check the modules dictionary if there's one there, and if not,
|
||||||
create a new one and insert in in the modules dictionary.
|
create a new one and insert in in the modules dictionary.
|
||||||
|
Return \NULL{} with an exception set on failure.
|
||||||
\note{This function does not load or import the module; if the
|
\note{This function does not load or import the module; if the
|
||||||
module wasn't already loaded, you will get an empty module object.
|
module wasn't already loaded, you will get an empty module object.
|
||||||
Use \cfunction{PyImport_ImportModule()} or one of its variants to
|
Use \cfunction{PyImport_ImportModule()} or one of its variants to
|
||||||
import a module. Return \NULL{} with an exception set on failure.}
|
import a module. Package structures implied by a dotted name for
|
||||||
|
\var{name} are not created if not already present.}
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
\begin{cfuncdesc}{PyObject*}{PyImport_ExecCodeModule}{char *name, PyObject *co}
|
\begin{cfuncdesc}{PyObject*}{PyImport_ExecCodeModule}{char *name, PyObject *co}
|
||||||
|
|
@ -160,8 +162,10 @@ values from C values.
|
||||||
built-in function \function{compile()}\bifuncindex{compile}, load
|
built-in function \function{compile()}\bifuncindex{compile}, load
|
||||||
the module. Return a new reference to the module object, or \NULL{}
|
the module. Return a new reference to the module object, or \NULL{}
|
||||||
with an exception set if an error occurred (the module may still be
|
with an exception set if an error occurred (the module may still be
|
||||||
created in this case). (This function would reload the module if it
|
created in this case). This function would reload the module if it
|
||||||
was already imported.)
|
was already imported. If \var{name} points to a dotted name of the
|
||||||
|
form \code{package.module}, any package structures not already
|
||||||
|
created will still not be created.
|
||||||
\end{cfuncdesc}
|
\end{cfuncdesc}
|
||||||
|
|
||||||
\begin{cfuncdesc}{long}{PyImport_GetMagicNumber}{}
|
\begin{cfuncdesc}{long}{PyImport_GetMagicNumber}{}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue