Brian Granger wrote:
> Hi,
>
> A few years ago, Ondrej asked a question about _sig_on/_sig_off being 
> in Cython itself:
>
> http://codespeak.net/pipermail/cython-dev/2008-November/003081.html
>
> William brought up the possibility of moving the relevant code from 
> Sage to Cython.
>
> Questions?
>
> * Has anyone worked on this?
> * If not, is it still a possibility? 
> * Can the relevant code from Sage be re-licensed for Cython?
>
> With some help, I might be able to work on this.
I can't help you, I'll just +1 it, I'd love to see features for signal 
handling in Cython.

The level of integration is worth thinking about though. The simplest 
thing is probably to just include Sage's stuff in the "Cython standard 
library" in Cython/Includes (assuming relicensing can be arranged). At 
least on a longer term, I think we should aim for something like (I'm 
just throwing it out there, let's wait with discussing the details until 
someone is ready to tackle it...)

try:
    with cython.trap_signals():
        call_my_c_func()
except cython.TrappedSignalError as e:
    cleanup_c_library_state()
    e.raise_python() # could raise e.g. KeyboardInterrupt


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

Reply via email to