#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 jdemeyer):

 Replying to [comment:21 pbruin]:
 > 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.
 Indeed. The Python `SIGINT` handler is changed in `_init_csage()` from
 `devel/sage/sage/ext/c_lib.pyx`.

 > 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`?
 Exactly.

--
Ticket URL: <http://trac.sagemath.org/ticket/13311#comment:22>
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.

Reply via email to