STINNER Victor added the comment:

> You are clearing the thread state of the currently executing
> thread, which doesn't sound right.

Oh, I didn't realize that PyThreadState_Clear() clears also Python thread 
locals.

Here is a new patch without PyThreadState_Clear(tstate) and with two unit tests:

- ensure that Python thread locals are not destroyed before destructors are 
called
- ensure that object destructors are called before Python thread states are 
destroyed

----------
Added file: http://bugs.python.org/file32500/finalize_threads-2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19466>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to