On Wed, Mar 10, 2010 at 12:32 PM, Brian Granger <ellisonbg....@gmail.com> wrote: > Ondrej, > > On Wed, Mar 10, 2010 at 12:25 PM, Ondrej Certik <ond...@certik.cz> wrote: >> >> On Wed, Mar 10, 2010 at 11:18 AM, Robert Bradshaw >> <rober...@math.washington.edu> wrote: >> > On Mar 10, 2010, at 11:01 AM, Brian Granger wrote: >> > >> >> Hello all, >> >> >> >> In the older Cython docs here: >> >> >> >> >> >> >> >> http://modular.math.washington.edu/home/was/www/home/gfurnish/old/sage-3.0.6/doc/prog/node55.html >> >> >> >> The _sig_on and _sig_off macros are mentioned. But, when I try these >> >> in >> >> current Cython it fails. I found this >> >> thread started by Ondrej a few years ago: >> >> >> >> http://codespeak.net/pipermail/cython-dev/2008-November/003081.html >> >> >> >> in which William brought up the possibility of moving the relevant code >> >> from Sage to Cython. William, >> >> are you willing to relicense the interrupt.h and interrupt.c functions >> >> under LGPL or another license >> >> that would allow their inclusion in Cython and other Cython using >> >> projects? I would like to port these >> >> to Cython and try to add Windows support. >> > >> > That would be great! >> > >> >> This would really be great! I didn't have time to finish this, but it >> annoys me a lot in our solvers, that I can't kill it easily. >> > > Yep, I have the same issue. > >> >> The only problem in my case is that I am mixing Python and C++ too >> much, I don't know what happens if you do >> >> _sig_on >> # some C++ stuff, that calls Python.... >> _sig_off > > Hopefully we will find out! Might be a bit messy though.
essentially, 98% of the time is spent in pure C++ code, but then it calls some Python at the end (for convert matrices to different formats using scipy etc.) internally. So once it gets into python, then ctrl-C works fine (raises an exception, that gets propagated into a C++ exception, that gets converted back to a Python exception and all is fine), but that 98% don't work with ctrl-C. So maybe this _sig_off can somehow get called from my Python() class in C++, that handles the interaction with Python. I've looked into the pynac and only expression.pyx contains sig_off/sig_on, for example in the _derivative(). So either _derivative will never invoke any python code, or it works. Ondrej -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org