summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-10-06 22:40:22 (GMT)
committerGitHub <noreply@github.com>2022-10-06 22:40:22 (GMT)
commite1c4d56fdde28728c37de855edbb463fa0d7f95d (patch)
treeb4c3a715e975f6349a8b07d856965fffb911f26d /Doc/library
parentf8edc6ff531bb98858185857513371f14519ed1d (diff)
downloadcpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.zip
cpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.tar.gz
cpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.tar.bz2
gh-65961: Do not rely solely on `__cached__` (GH-97990)
Make sure `__spec__.cached` (at minimum) can be used.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/runpy.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst
index 26a4f14..501f4dd 100644
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -93,6 +93,11 @@ The :mod:`runpy` module provides two functions:
run this way, as well as ensuring the real module name is always
accessible as ``__spec__.name``.
+ .. versionchanged:: 3.12
+ The setting of ``__cached__``, ``__loader__``, and
+ ``__package__`` are deprecated. See
+ :class:`~importlib.machinery.ModuleSpec` for alternatives.
+
.. function:: run_path(path_name, init_globals=None, run_name=None)
.. index::
@@ -163,6 +168,10 @@ The :mod:`runpy` module provides two functions:
case where ``__main__`` is imported from a valid sys.path entry rather
than being executed directly.
+ .. versionchanged:: 3.12
+ The setting of ``__cached__``, ``__loader__``, and
+ ``__package__`` are deprecated.
+
.. seealso::
:pep:`338` -- Executing modules as scripts