]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112826: Add a "What's New" Entry About _thread._is_main_interpreter (gh-112853)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 7 Dec 2023 20:22:15 +0000 (13:22 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Dec 2023 20:22:15 +0000 (13:22 -0700)
As of gh-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 (gh-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+.

Doc/whatsnew/3.12.rst
Doc/whatsnew/3.13.rst

index 07d22a4a5fb7736fd82946d15cc19d93e2b4321e..8551b35438e2c3e11e29ab344a03ada0deb76fb1 100644 (file)
@@ -1895,6 +1895,15 @@ Changes in the Python API
   * Mixing tabs and spaces as indentation in the same file is not supported anymore and will
     raise a :exc:`TabError`.
 
+* The :mod:`threading` module now expects the :mod:`!_thread` module to have
+  an ``_is_main_interpreter`` attribute.  It is a function with no
+  arguments that returns ``True`` if the current interpreter is the
+  main interpreter.
+
+  Any library or application that provides a custom ``_thread`` module
+  should provide ``_is_main_interpreter()``.
+  (See :gh:`112826`.)
+
 Build Changes
 =============
 
index 9adf7a3893bd7081b6818c2db154d66a0a93eb07..4401deb0768c1145d5c291891ce30ac48f361cd3 100644 (file)
@@ -1082,6 +1082,16 @@ Changes in the Python API
   retrieve a username, instead of :exc:`ImportError` on non-Unix platforms or
   :exc:`KeyError` on Unix platforms where the password database is empty.
 
+* The :mod:`threading` module now expects the :mod:`!_thread` module to have
+  an ``_is_main_interpreter`` attribute.  It is a function with no
+  arguments that returns ``True`` if the current interpreter is the
+  main interpreter.
+
+  Any library or application that provides a custom ``_thread`` module
+  must provide ``_is_main_interpreter()``, just like the module's
+  other "private" attributes.
+  (See :gh:`112826`.)
+
 
 Build Changes
 =============