diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2014-05-12 17:54:55 -0600 |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2014-05-12 17:54:55 -0600 |
commit | 21d850401b1f4fc3ab40bd327bffd4299178316e (patch) | |
tree | 3671743b96563ef7f3900e6f9c111ccc58f7537e /Doc/c-api/import.rst | |
parent | 83f21f4b89517ffc3ef1e23e394876ced7578569 (diff) | |
download | cpython-21d850401b1f4fc3ab40bd327bffd4299178316e.tar.gz |
Issue #21226: Set all attrs in PyImport_ExecCodeModuleObject.
Diffstat (limited to 'Doc/c-api/import.rst')
-rw-r--r-- | Doc/c-api/import.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index 0dcac2d4cf..3641fc69b1 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -132,8 +132,14 @@ Importing Modules such modules have no way to know that the module object is an unknown (and probably damaged with respect to the module author's intents) state. + The module's :attr:`__spec__` and :attr:`__loader__` will be set, if + not set already, with the appropriate values. The spec's loader will + be set to the module's ``__loader__`` (if set) and to an instance of + :class:`SourceFileLoader` otherwise. + The module's :attr:`__file__` attribute will be set to the code object's - :c:member:`co_filename`. + :c:member:`co_filename`. If applicable, :attr:`__cached__` will also + be set. This function will reload the module if it was already imported. See :c:func:`PyImport_ReloadModule` for the intended way to reload a module. |