bpo-38644: Make tstate more explicit inside pystate.c (GH-19182) · python/cpython@71a3522 · GitHub
Skip to content

Commit 71a3522

Browse files
authored
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).
1 parent 7281898 commit 71a3522

3 files changed

Lines changed: 67 additions & 47 deletions

File tree

Doc/c-api/init.rst

Lines changed: 2 additions & 0 deletions

Doc/c-api/module.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ since multiple such modules can be created from a single definition.
527527
mechanisms (either by calling it directly, or by referring to its
528528
implementation for details of the required state updates).
529529
530+
The caller must hold the GIL.
531+
530532
Return 0 on success or -1 on failure.
531533
532534
.. versionadded:: 3.3
@@ -536,4 +538,6 @@ since multiple such modules can be created from a single definition.
536538
Removes the module object created from *def* from the interpreter state.
537539
Return 0 on success or -1 on failure.
538540
541+
The caller must hold the GIL.
542+
539543
.. versionadded:: 3.3

Python/pystate.c

Lines changed: 61 additions & 47 deletions

0 commit comments

Comments
 (0)