Skip to content

Commit 2dca569

Browse files
committed
More deprecation warning improvements
1 parent 309a9cf commit 2dca569

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ Pending Removal in Python 3.15
66
* Setting :attr:`~module.__cached__` on a module while
77
failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>`
88
is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or
9-
take into consideration by the import system or standard library.
9+
take into consideration by the import system or standard library. (:gh:`97879`)
10+
11+
* Setting :attr:`~module.__package__` on a module while
12+
failing to set :attr:`__spec__.parent <importlib.machinery.ModuleSpec.parent>`
13+
is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or
14+
take into consideration by the import system or standard library. (:gh:`97879`)
1015

1116
* :mod:`ctypes`:
1217

@@ -24,9 +29,6 @@ Pending Removal in Python 3.15
2429
* The :option:`!--cgi` flag to the :program:`python -m http.server`
2530
command-line interface has been deprecated since Python 3.13.
2631

27-
* :mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or
28-
taken into consideration by the import system (:gh:`97879`).
29-
3032
* :class:`locale`:
3133

3234
* The :func:`~locale.getdefaultlocale` function

Doc/whatsnew/3.12.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,14 +1309,15 @@ Deprecated
13091309
may be removed in a future version of Python. Use the single-arg versions
13101310
of these functions instead. (Contributed by Ofey Chan in :gh:`89874`.)
13111311

1312-
* :exc:`DeprecationWarning` is now raised when ``__package__`` on a
1313-
module differs from ``__spec__.parent`` (previously it was
1314-
:exc:`ImportWarning`).
1312+
* :exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on a
1313+
module differs from
1314+
:attr:`__spec__.parent <importlib.machinery.ModuleSpec.parent>` (previously
1315+
it was :exc:`ImportWarning`).
13151316
(Contributed by Brett Cannon in :gh:`65961`.)
13161317

1317-
* Setting ``__package__`` or ``__cached__`` on a module is deprecated,
1318-
and will cease to be set or taken into consideration by the import system in Python 3.14.
1319-
(Contributed by Brett Cannon in :gh:`65961`.)
1318+
* Setting :attr:`~module.__package__`` or :attr:`~module.__cached__` on a
1319+
module is deprecated, and will cease to be set or taken into consideration by
1320+
the import system in Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)
13201321

13211322
* The bitwise inversion operator (``~``) on bool is deprecated. It will throw an
13221323
error in Python 3.16. Use ``not`` for logical negation of bools instead.

0 commit comments

Comments
 (0)