bpo-38644: Make tstate more explicit inside pystate.c (GH-19182)

Fix PyInterpreterState_New(): Don't call PyErr_SetString() when there
is no current Python thread state (if tstate is NULL).
This commit is contained in:
Victor Stinner 2020-03-26 22:46:14 +01:00 committed by GitHub
parent 728189884e
commit 71a3522ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 47 deletions

View file

@ -1119,6 +1119,8 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
Return the interpreter's unique ID. If there was any error in doing
so then ``-1`` is returned and an error is set.
The caller must hold the GIL.
.. versionadded:: 3.7

View file

@ -527,6 +527,8 @@ since multiple such modules can be created from a single definition.
mechanisms (either by calling it directly, or by referring to its
implementation for details of the required state updates).
The caller must hold the GIL.
Return 0 on success or -1 on failure.
.. versionadded:: 3.3
@ -536,4 +538,6 @@ since multiple such modules can be created from a single definition.
Removes the module object created from *def* from the interpreter state.
Return 0 on success or -1 on failure.
The caller must hold the GIL.
.. versionadded:: 3.3