On Fri, Aug 27, 2010 at 7:11 AM, Brian Blais <[email protected]> wrote:
> Hello,
>
> I have a loop like:
>
> try:
>     for i in range(1000:
>         do_something_with_a_loop_in_cython()
> except KeyboardInterrupt:
>     cleanup()
>
> but unless I happen to hit Ctrl-C while it is in the python part, I
> get an interrupt ignore warning.  Is there a way to catch the Ctrl-C
> to prematurely exit out of the cython loop?

You can also set up your own signal handler like we do in Sage.

http://hg.sagemath.org/sage-main/file/5b338f2e484f/c_lib/include/interrupt.h#l1

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to