Skip to content

Commit d98bb49

Browse files
ericsnowcurrentlyGlyphack
authored andcommitted
pythongh-112826: Add a "What's New" Entry About _thread._is_main_interpreter (pythongh-112853)
As of pythongh-112661, the threading module expects the _thread module to have a _is_main_interpreter(), which is used in the internal threading._shutdown(). This change causes a problem for anyone that replaces the _thread module with a custom one (only if they don't provide _is_main_interpreter()). They need to be sure to add it for 3.13+, thus this PR is adding a note in "What's New". This also forward-ports the "What's New" entry from 3.12 (pythongh-112850). Note that we do not also forward-port the fix in that PR. The fix is there only due to a regression from 3.12.0. There is no regression in 3.13+.
1 parent 18d70b6 commit d98bb49

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,15 @@ Changes in the Python API
18951895
* Mixing tabs and spaces as indentation in the same file is not supported anymore and will
18961896
raise a :exc:`TabError`.
18971897

1898+
* The :mod:`threading` module now expects the :mod:`!_thread` module to have
1899+
an ``_is_main_interpreter`` attribute. It is a function with no
1900+
arguments that returns ``True`` if the current interpreter is the
1901+
main interpreter.
1902+
1903+
Any library or application that provides a custom ``_thread`` module
1904+
should provide ``_is_main_interpreter()``.
1905+
(See :gh:`112826`.)
1906+
18981907
Build Changes
18991908
=============
19001909

Doc/whatsnew/3.13.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,16 @@ Changes in the Python API
10821082
retrieve a username, instead of :exc:`ImportError` on non-Unix platforms or
10831083
:exc:`KeyError` on Unix platforms where the password database is empty.
10841084

1085+
* The :mod:`threading` module now expects the :mod:`!_thread` module to have
1086+
an ``_is_main_interpreter`` attribute. It is a function with no
1087+
arguments that returns ``True`` if the current interpreter is the
1088+
main interpreter.
1089+
1090+
Any library or application that provides a custom ``_thread`` module
1091+
must provide ``_is_main_interpreter()``, just like the module's
1092+
other "private" attributes.
1093+
(See :gh:`112826`.)
1094+
10851095

10861096
Build Changes
10871097
=============

0 commit comments

Comments
 (0)