#11310: Monkey-patch catchall `except:` statements so they at least don't catch
`KeyboardInterrupt` errors
------------------------------------------------+---------------------------
Reporter: jdemeyer | Owner: jason
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-5.3
Component: misc | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Keshav Kini
Authors: Jeroen Demeyer, Volker Braun | Merged in:
Dependencies: #13109 | Stopgaps:
------------------------------------------------+---------------------------
Changes (by jdemeyer):
* status: positive_review => needs_work
Old description:
> There are a lot places in the Sage library which use
> {{{
> except:
> }}}
> This is bad because it catches non-errors like `KeyboardInterrupt`.
>
> ----
>
> The patch [attachment:trac_11310.patch] fixes some of these.
> Then the patch [attachment:11310_auto.patch] has ben auto-generated to
> replace all remaining instances of
> {{{
> except:
> }}}
> by
> {{{
> except StandardError:
> }}}
> and all instances of
> {{{
> raise Exception
> }}}
> by
> {{{
> raise RuntimeError
> }}}
>
> ----
>
> '''Apply''' [attachment:trac_11310.patch] and
> [attachment:11310_auto.patch]
New description:
There are a lot places in the Sage library which use
{{{
except:
}}}
This is bad because it catches non-errors like `KeyboardInterrupt`.
----
Then the patch [attachment:11310_auto.patch] has ben auto-generated to
replace all instances of
{{{
except:
}}}
by
{{{
except StandardError:
}}}
and all instances of
{{{
raise Exception
}}}
by
{{{
raise RuntimeError
}}}
----
'''Apply''' [attachment:trac_11310.patch] and
[attachment:11310_auto.patch] and [attachment:11310_psage.patch].
--
Comment:
Additional patch [attachment:11310_psage.patch] needs review (there were
sporadic doctest failures in `psage.py`).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11310#comment:28>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.