mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104674)
This commit is contained in:
parent
2c4e29e322
commit
357bed0bcd
4 changed files with 47 additions and 7 deletions
|
|
@ -167,6 +167,10 @@ the same library that the Python runtime is using.
|
|||
event loops, as done in the :file:`Modules/_tkinter.c` in the
|
||||
Python source code.
|
||||
|
||||
.. versionchanged:: 3.12
|
||||
This function is only called from the
|
||||
:ref:`main interpreter <sub-interpreter-support>`.
|
||||
|
||||
|
||||
.. c:var:: char* (*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *)
|
||||
|
||||
|
|
@ -187,6 +191,10 @@ the same library that the Python runtime is using.
|
|||
:c:func:`PyMem_RawRealloc`, instead of being allocated by
|
||||
:c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`.
|
||||
|
||||
.. versionchanged:: 3.12
|
||||
This function is only called from the
|
||||
:ref:`main interpreter <sub-interpreter-support>`.
|
||||
|
||||
.. c:function:: PyObject* PyRun_String(const char *str, int start, PyObject *globals, PyObject *locals)
|
||||
|
||||
This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving
|
||||
|
|
|
|||
|
|
@ -1476,6 +1476,15 @@ Porting to Python 3.12
|
|||
Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12)
|
||||
already disallows creating classes whose metaclass overrides ``tp_new``.
|
||||
|
||||
* :c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no
|
||||
longer called in :ref:`subinterpreters <sub-interpreter-support>`. This is
|
||||
because clients generally rely on process-wide global state (since these
|
||||
callbacks have no way of recovering extension module state).
|
||||
|
||||
This also avoids situations where extensions may find themselves running in a
|
||||
subinterpreter that they don't support (or haven't yet been loaded in). See
|
||||
:gh:`104668` for more info.
|
||||
|
||||
Deprecated
|
||||
----------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue