From 675f5fa53ec66a361aaec73bb13fa24a9f2dddb5 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 22 Sep 2023 19:48:05 +0100 Subject: [PATCH] Merge the `imp` porting bullets; re-word the intro --- Doc/whatsnew/3.12.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 1223f859265ed9..4055d4b915aebc 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1390,7 +1390,7 @@ imp * The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :gh:`98040`.) -* Replace removed :mod:`!imp` functions with :mod:`importlib` functions: + To migrate, consult the following correspondence table: ================================= ======================================= imp importlib @@ -1405,9 +1405,10 @@ imp ``imp.new_module(name)`` ``types.ModuleType(name)`` ``imp.reload()`` :func:`importlib.reload` ``imp.source_from_cache()`` :func:`importlib.util.source_from_cache` + ``imp.load_source()`` *See below* ================================= ======================================= -* Replace ``imp.load_source()`` with:: + Replace ``imp.load_source()`` with:: import importlib.util import importlib.machinery