This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1490720781.89.0.956160551595.issue29926@psf.upfronthosting.co.za>
In-reply-to
Content
(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.)
History
Date User Action Args
2017-03-28 17:06:21njssetrecipients: + njs, terry.reedy, Mark, eryksun
2017-03-28 17:06:21njssetmessageid: <1490720781.89.0.956160551595.issue29926@psf.upfronthosting.co.za>
2017-03-28 17:06:21njslinkissue29926 messages
2017-03-28 17:06:21njscreate