SIGN IN SIGN UP

bpo-32604: Swap threads only if the interpreter is different. (gh-5778)

The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same.
E
Eric Snow committed
f53d9f2778a87bdd48eb9030f782a4ebf9e7622f
Parent: 80d20b9
Committed by GitHub <noreply@github.com> on 2/20/2018, 11:30:17 PM