Module written in C does not repond to Ctrl-C interruption.

Daniel Dittmar daniel at dittmar.net
Sat Feb 25 08:49:42 EST 2006


Bo Peng wrote:
> Daniel Dittmar wrote:
> 
>>
>> You could set up your own signal handler when entering the C 
>> extension. This should abort the extension (tricky) and call the 
>> Python signal handler.
> 
> 
> This can be done under linux using things in signal.h but I am not
> sure whether or not there is a portable way to do it (max, win32).
> Does anybody know a quick way under windows?


SetConsoleCtrlHandler:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsolectrlhandler.asp

Daniel



More information about the Python-list mailing list