[Python-checkins] bpo-33612: Remove PyThreadState_Clear() assertion (GH-7069) (GH-7074)

Ned Deily webhook-mailer at python.org
Wed May 23 15:58:26 EDT 2018


https://github.com/python/cpython/commit/508d7693bc09affd99fdaa4a321cc3da0638c8a0
commit: 508d7693bc09affd99fdaa4a321cc3da0638c8a0
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-05-23T15:58:21-04:00
summary:

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 b6dccf54fd3bac9c87348d96f9d6b571608c15bc)

Co-authored-by: Victor Stinner <vstinner at redhat.com>

files:
M Python/pystate.c

diff --git a/Python/pystate.c b/Python/pystate.c
index 7750f4ca8a55..15761e7da90f 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -581,7 +581,6 @@ PyThreadState_Clear(PyThreadState *tstate)
     Py_CLEAR(tstate->exc_state.exc_traceback);
 
     /* 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) {
         fprintf(stderr,
           "PyThreadState_Clear: warning: thread still has a generator\n");



More information about the Python-checkins mailing list