Skip to content

Commit 328435e

Browse files
authored
GH-98040: Suppress cross-references to the removed imp module (#104131)
Suppress cross-references to imp
1 parent 3269978 commit 328435e

File tree

11 files changed

+20
-19
lines changed

11 files changed

+20
-19
lines changed

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ Importing Modules
186186
187187
.. versionadded:: 3.2
188188
.. versionchanged:: 3.3
189-
Uses :func:`imp.source_from_cache()` in calculating the source path if
189+
Uses :func:`!imp.source_from_cache()` in calculating the source path if
190190
only the bytecode path is provided.
191191
.. versionchanged:: 3.12
192-
No longer uses the removed ``imp`` module.
192+
No longer uses the removed :mod:`!imp` module.
193193
194194
195195
.. c:function:: long PyImport_GetMagicNumber()

Doc/library/functions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,7 @@ are always available. They are listed here in alphabetical order.
19871987

19881988
.. index::
19891989
statement: import
1990+
module: builtins
19901991

19911992
.. note::
19921993

Doc/whatsnew/3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ Builtins
840840
need it; however, 99 percent of the time an explicit :keyword:`for`
841841
loop is more readable.
842842

843-
* Removed :func:`reload`. Use :func:`imp.reload`.
843+
* Removed :func:`reload`. Use :func:`!imp.reload`.
844844

845845
* Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator
846846
instead.

Doc/whatsnew/3.10.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ Deprecated
16821682
classes as appropriate instead.
16831683
(Contributed by Brett Cannon in :issue:`42135`.)
16841684
1685-
* The deprecations of :mod:`imp`, :func:`!importlib.find_loader`,
1685+
* The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`,
16861686
:func:`importlib.util.set_package_wrapper`,
16871687
:func:`importlib.util.set_loader_wrapper`,
16881688
:func:`importlib.util.module_for_loader`,

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ C APIs pending removal are
18721872
* The :mod:`asynchat` module
18731873
* The :mod:`asyncore` module
18741874
* The :ref:`entire distutils package <distutils-deprecated>`
1875-
* The :mod:`imp` module
1875+
* The :mod:`!imp` module
18761876
* The :class:`typing.io <typing.IO>` namespace
18771877
* The :class:`typing.re <typing.Pattern>` namespace
18781878
* :func:`!cgi.log`

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Removed
995995
* ``importlib.abc.Finder``, ``pkg.ImpImporter``, and ``pkg.ImpLoader`` have
996996
been removed. (Contributed by Barry Warsaw in :gh:`98040`.)
997997

998-
* The ``imp`` module has been removed. (Contributed by Barry Warsaw in
998+
* The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in
999999
:gh:`98040`.)
10001000

10011001
* Removed the ``suspicious`` rule from the documentation Makefile, and

Doc/whatsnew/3.2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ aspects that are visible to the programmer:
319319
>>> collections.__cached__ # doctest: +SKIP
320320
'c:/py32/lib/__pycache__/collections.cpython-32.pyc'
321321

322-
* The tag that is unique to each interpreter is accessible from the :mod:`imp`
322+
* The tag that is unique to each interpreter is accessible from the :mod:`!imp`
323323
module:
324324

325325
>>> import imp # doctest: +SKIP
@@ -328,7 +328,7 @@ aspects that are visible to the programmer:
328328

329329
* Scripts that try to deduce source filename from the imported file now need to
330330
be smarter. It is no longer sufficient to simply strip the "c" from a ".pyc"
331-
filename. Instead, use the new functions in the :mod:`imp` module:
331+
filename. Instead, use the new functions in the :mod:`!imp` module:
332332

333333
>>> imp.source_from_cache('c:/py32/lib/__pycache__/collections.cpython-32.pyc') # doctest: +SKIP
334334
'c:/py32/lib/collections.py'

Doc/whatsnew/3.3.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ through normal attribute access.
685685
Using importlib as the Implementation of Import
686686
===============================================
687687
:issue:`2377` - Replace __import__ w/ importlib.__import__
688-
:issue:`13959` - Re-implement parts of :mod:`imp` in pure Python
688+
:issue:`13959` - Re-implement parts of :mod:`!imp` in pure Python
689689
:issue:`14605` - Make import machinery explicit
690690
:issue:`14646` - Require loaders set __loader__ and __package__
691691

@@ -762,7 +762,7 @@ Loaders are also now expected to set the ``__package__`` attribute from
762762
from :mod:`importlib` and import itself is setting the attribute post-load.
763763

764764
``None`` is now inserted into :attr:`sys.path_importer_cache` when no finder
765-
can be found on :attr:`sys.path_hooks`. Since :class:`imp.NullImporter` is not
765+
can be found on :attr:`sys.path_hooks`. Since :class:`!imp.NullImporter` is not
766766
directly exposed on :attr:`sys.path_hooks` it could no longer be relied upon to
767767
always be available to use as a value representing no finder found.
768768

@@ -2385,7 +2385,7 @@ Porting Python code
23852385
* Because ``None`` is now inserted into :attr:`sys.path_importer_cache`, if you
23862386
are clearing out entries in the dictionary of paths that do not have a
23872387
finder, you will need to remove keys paired with values of ``None`` **and**
2388-
:class:`imp.NullImporter` to be backwards-compatible. This will lead to extra
2388+
:class:`!imp.NullImporter` to be backwards-compatible. This will lead to extra
23892389
overhead on older versions of Python that re-insert ``None`` into
23902390
:attr:`sys.path_importer_cache` where it represents the use of implicit
23912391
finders, but semantically it should not change anything.

Doc/whatsnew/3.4.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -991,18 +991,18 @@ for the :meth:`~importlib.abc.InspectLoader.get_code` method. However,
991991
it will normally be desirable to override the default implementation
992992
for performance reasons. (Contributed by Brett Cannon in :issue:`18072`.)
993993

994-
The :func:`~importlib.reload` function has been moved from :mod:`imp` to
995-
:mod:`importlib` as part of the :mod:`imp` module deprecation. (Contributed by
994+
The :func:`~importlib.reload` function has been moved from :mod:`!imp` to
995+
:mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed by
996996
Berker Peksag in :issue:`18193`.)
997997

998998
:mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` attribute
999999
providing access to the bytecode version number. This replaces the
1000-
:func:`~imp.get_magic` function in the deprecated :mod:`imp` module.
1000+
:func:`!get_magic` function in the deprecated :mod:`!imp` module.
10011001
(Contributed by Brett Cannon in :issue:`18192`.)
10021002

10031003
New :mod:`importlib.util` functions :func:`~importlib.util.cache_from_source`
10041004
and :func:`~importlib.util.source_from_cache` replace the same-named functions
1005-
in the deprecated :mod:`imp` module. (Contributed by Brett Cannon in
1005+
in the deprecated :mod:`!imp` module. (Contributed by Brett Cannon in
10061006
:issue:`18194`.)
10071007

10081008
The :mod:`importlib` bootstrap :class:`.NamespaceLoader` now conforms to
@@ -2101,7 +2101,7 @@ Deprecations in the Python API
21012101
and :meth:`importlib.util.set_package` are no longer needed because their
21022102
functions are now handled automatically by the import system.
21032103

2104-
* The :mod:`imp` module is pending deprecation. To keep compatibility with
2104+
* The :mod:`!imp` module is pending deprecation. To keep compatibility with
21052105
Python 2/3 code bases, the module's removal is currently not scheduled.
21062106

21072107
* The :mod:`formatter` module is pending deprecation and is slated for removal
@@ -2300,7 +2300,7 @@ Changes in the Python API
23002300
then you can see if the module's ``__spec__.location`` is set to ``'frozen'``,
23012301
check if the loader is a subclass of
23022302
:class:`importlib.machinery.FrozenImporter`,
2303-
or if Python 2 compatibility is necessary you can use :func:`imp.is_frozen`.
2303+
or if Python 2 compatibility is necessary you can use :func:`!imp.is_frozen`.
23042304

23052305
* :func:`py_compile.compile` now raises :exc:`FileExistsError` if the file path
23062306
it would write to is a symlink or a non-regular file. This is to act as a

Doc/whatsnew/3.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ Changes in the Python API
21802180
now raises :exc:`ValueError` for out-of-range values, rather than
21812181
returning :const:`None`. See :issue:`20059`.
21822182

2183-
* The :mod:`imp` module now raises a :exc:`DeprecationWarning` instead of
2183+
* The :mod:`!imp` module now raises a :exc:`DeprecationWarning` instead of
21842184
:exc:`PendingDeprecationWarning`.
21852185

21862186
* The following modules have had missing APIs added to their :attr:`__all__`

Misc/NEWS.d/3.8.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3818,7 +3818,7 @@ user.
38183818
.. section: Library
38193819
38203820
The :2to3fixer:`reload` fixer now uses :func:`importlib.reload` instead of
3821-
deprecated :func:`imp.reload`.
3821+
deprecated :func:`!imp.reload`.
38223822

38233823
..
38243824

0 commit comments

Comments
 (0)