Author njs
Recipients Mark, eryksun, njs, terry.reedy
Date 2017-03-28.17:06:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
(oh, in case it wasn't obvious: the advantage of raise() over kill() and pthread_kill() is that raise() works everywhere, including Windows, so it would avoid platform specific logic. Or if you don't like raise() for some reason then you can get the same effect by doing handler = PyOS_getsig(SIGINT); if (handler) handler(SIGINT); )

(Also, this is all assuming the python 3 logic on Windows. On Windows versions of python 2 I can't see any way to make time.sleep interruptible without significant rewriting. The problem is that on py2 the special Event used to signal the arrival of a control-C is a private variable that gets hooked up directly to Windows's low-level control-C logic, and there's effectively no way to get at it from outside. You might think GenerateConsoleCtrlEvent would help, but it is broken in too many ways for me to fit in this text box.)
Date User Action Args
2017-03-28 17:06:21njssetrecipients: + njs, terry.reedy, Mark, eryksun
2017-03-28 17:06:21njssetmessageid: <>
2017-03-28 17:06:21njslinkissue29926 messages
2017-03-28 17:06:21njscreate