summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2017-09-04 17:54:09 -0600
committerGitHub <noreply@github.com>2017-09-04 17:54:09 -0600
commit86b7afdfeee77993fe896a2aa13b3f4f95973f16 (patch)
treea37fbb7233319c671e4787bff683629148cab971 /Doc
parentf5ea83f4864232fecc042ff0d1c2401807b19280 (diff)
downloadcpython-git-86b7afdfeee77993fe896a2aa13b3f4f95973f16.tar.gz
bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
sys.modules is the one true source.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/import.rst7
-rw-r--r--Doc/whatsnew/3.7.rst3
2 files changed, 10 insertions, 0 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index 7c16ece058..8cdc256e7c 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -204,6 +204,13 @@ Importing Modules
Return the dictionary used for the module administration (a.k.a.
``sys.modules``). Note that this is a per-interpreter variable.
+.. c:function:: PyObject* PyImport_GetModule(PyObject *name)
+
+ Return the already imported module with the given name. If the
+ module has not been imported yet then returns NULL but does not set
+ an error. Returns NULL and sets an error if the lookup failed.
+
+ .. versionadded:: 3.7
.. c:function:: PyObject* PyImport_GetImporter(PyObject *path)
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index f0c50e89a6..7a5d1e5685 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -456,6 +456,9 @@ Changes in the Python API
and module are affected by this change. (Contributed by INADA Naoki and
Eugene Toder in :issue:`29463`.)
+* ``PyInterpreterState`` no longer has a ``modules`` field. Instead use
+ ``sys.modules``.
+
* The *mode* argument of :func:`os.makedirs` no longer affects the file
permission bits of newly-created intermediate-level directories.
To set their file permission bits you can set the umask before invoking