KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Tolf
Dear List, I was writing a Python extension module, including a sleeping call to poll(2), and noticed, to my great surprise (and joy), that even when blocking there, KeyboardInterrupt still worked properly when sending SIGINTs to the interpreter. It really got me wondering how it works, though.

Re: KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Lundh
Fredrik Tolf wrote: So how does it work? Does my code get to return Py_FALSE, and the interpreter ignores it, seeing that an exception is set? Is a non-local exit performed right over my call stack (in which case my next question would be how to clean up resources being used from my C code)?

Re: KeyboardInterrupt from syscalls

2006-11-22 Thread Fredrik Tolf
On Wed, 2006-11-22 at 19:45 +0100, Fredrik Lundh wrote: Fredrik Tolf wrote: So how does it work? Does my code get to return Py_FALSE, and the interpreter ignores it, seeing that an exception is set? Is a non-local exit performed right over my call stack (in which case my next question