Steve Dower <[email protected]> added the comment:
This looks like the smallest change I can make to fix it:
diff --git a/Include/internal/pycore_pystate.h
b/Include/internal/pycore_pystate.h
index 0cd5550cfd..9ff740b87b 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -34,7 +34,11 @@ _Py_IsMainInterpreter(PyThreadState* tstate)
static inline int
_Py_ThreadCanHandleSignals(PyInterpreterState *interp)
{
+#ifndef MS_WINDOWS
return (_Py_IsMainThread() && interp == _PyRuntime.interpreters.main);
+#else
+ return (interp == _PyRuntime.interpreters.main);
+#endif
}
I'll need Victor(?) to confirm whether checking for the main interpreter is
sufficient. We're calling this from a new thread that AFAICT never holds the
GIL, and we pass the main interpreter in explicitly (from trip_signal) so this
check always succeeds (here, but not necessarily in other places where it is
called).
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42296>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com