On Jun 20, 2009, at 10:21 PM, greg wrote:
Philip Semanchuk wrote:
Best of all, PyErr_CheckSignals() doesn't interfere with a Python-
level signal handler if one is set.
Ah, I hadn't realised that you were doing this in C
code, and I was trying to think of a Python-level
solution.
For C
greg g...@cosc.canterbury.ac.nz (g) wrote:
g Philip Semanchuk wrote:
try:
sem.acquire() # User hits Ctrl + C while this is waiting
except:
print * I caught it!
Instead a KeyboardInterrupt error is propagated up to the interpreter
and the process is killed as if the try/except
After my previous experiment I was curious how this works with
input(). I replaced the sem.acquire() with raw_input() and ran the same
tests. Now the inner exception is really taken so it works like the OP
expected. The exception, however is KeyboardInterrupt, not the special
exception from the
On Jun 20, 2009, at 7:41 AM, Piet van Oostrum wrote:
After my previous experiment I was curious how this works with
input(). I replaced the sem.acquire() with raw_input() and ran the
same
tests. Now the inner exception is really taken so it works like the OP
expected. The exception, however
Philip Semanchuk wrote:
Best of all, PyErr_CheckSignals() doesn't interfere with a Python- level
signal handler if one is set.
Ah, I hadn't realised that you were doing this in C
code, and I was trying to think of a Python-level
solution.
For C code, the solution you give sounds like a
good
Philip Semanchuk wrote:
try:
sem.acquire() # User hits Ctrl + C while this is waiting
except:
print * I caught it!
Instead a KeyboardInterrupt error is propagated up to the interpreter
and the process is killed as if the try/except wasn't there at all.
Not sure exactly
Hi all,
I need help understanding how Python deals with Ctrl-C.
A user has reported a bug in my posix_ipc module. When a Python app is
waiting to acquire an IPC semaphore and the user hits Ctrl-C, my code
should return a custom error indicating that the semaphore wait was
interrupted by a