bpo-40010: COMPUTE_EVAL_BREAKER() checks for subinterpreter by vstinner · Pull Request #19087 · python/cpython

@vstinner

COMPUTE_EVAL_BREAKER() now also checks if the Python thread state
belongs to the main interpreter. Don't break the evaluation loop if
there are pending signals but the Python thread state it belongs to a
subinterpeter.

* Add _Py_IsMainThread() function.
* Add _Py_ThreadCanHandleSignals() function.

corona10