bpo-33612: Remove PyThreadState_Clear() assertion (GH-7069) (GH-7074)

bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear()
which failed at Python shutdown or on fork if a thread was running a
generator.
(cherry picked from commit b6dccf54fd)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-05-23 12:58:21 -07:00 committed by Ned Deily
parent 2fc443c469
commit 508d7693bc

View file

@ -581,7 +581,6 @@ PyThreadState_Clear(PyThreadState *tstate)
Py_CLEAR(tstate->exc_state.exc_traceback); Py_CLEAR(tstate->exc_state.exc_traceback);
/* The stack of exception states should contain just this thread. */ /* The stack of exception states should contain just this thread. */
assert(tstate->exc_info->previous_item == NULL);
if (Py_VerboseFlag && tstate->exc_info != &tstate->exc_state) { if (Py_VerboseFlag && tstate->exc_info != &tstate->exc_state) {
fprintf(stderr, fprintf(stderr,
"PyThreadState_Clear: warning: thread still has a generator\n"); "PyThreadState_Clear: warning: thread still has a generator\n");