0
0
mirror of https://github.com/python/cpython.git synced 2024-11-30 18:51:15 +01:00

GH-109190: Copyedit 3.12 What's New: Update the `imp` porting guidance (#109755)

This commit is contained in:
Adam Turner 2023-09-25 07:24:02 +01:00 committed by GitHub
parent 09a73d50f6
commit 7b8bfe1644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1411,7 +1411,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
@ -1426,9 +1426,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