#13311: alarm() doesn't work for Cython code
------------------------------------------+----------------------------
Reporter: alexc | Owner: jdemeyer
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.13
Component: c_lib | Resolution:
Keywords: alarm signal interrupt | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues: rebase
Branch: | Commit:
Dependencies: #14029 | Stopgaps:
------------------------------------------+----------------------------
Comment (by pbruin):
Replying to [comment:20 jdemeyer]:
> Replying to [comment:19 pbruin]:
> > Generating a `SIGALRM` outside `sig_on()...sig_off()` calls
`PyErr_SetInterrupt()`, which causes Python to raise a `KeyboardInterrupt`
> No, it doesn't. It causes IPython to print the string
{{{"KeyboardInterrupt"}}}.
I was mislead by the Python documentation, which says that
`PyErr_SetInterrupt()` causes a `KeyboardInterrupt` to be raised the next
time `PyErr_CheckSignals()` is called. In fact this only describes what
Python's default `SIGINT` handler does, which we don't use.
OK, so IPython prints the string `"KeyboardInterrupt"` in an `except
KeyboardInterrupt` block when it is reading input. Do I understand
correctly that the `KeyboardInterrupt` is in this case actually an
`AlarmInterrupt` and triggers this `except` block because it inherits from
`KeyboardInterrupt`?
--
Ticket URL: <http://trac.sagemath.org/ticket/13311#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.