#11945: Throw exception instead of printing error in c_graph.pyx
-------------------------------------+-------------------------------------
       Reporter:  kini               |        Owner:  jason, ncohen, rlm
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  graph theory       |   Resolution:
       Keywords:  cython exception   |    Merged in:
  cpdef print c_graph                |    Reviewers:
        Authors:  Jeroen Demeyer     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  2de64d45efaa70525932f6d086aef3afbef31cbe
  u/jdemeyer/ticket/11945            |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Description changed by jdemeyer:

Old description:

> The following text currently occurs in
> `$SAGE_ROOT/devel/sage/sage/graphs/base/c_graph.pyx`:
>
> {{{
> #!python
>         # The following is due to a hard to reproduce bug in Cython where
> except,
>         # cpdef, and classes don't play well together:
>         print "Not Implemented!"
>         # raise NotImplementedError() ... results in:
>         # Exception exceptions.NotImplementedError: NotImplementedError()
> in 'sage.graphs.base.c_graph.CGraph.has_arc' ignored
>         # False
> }}}
>
> There is no Cython bug, it's just a matter of properly declaring the
> `except` value in the `.pxd` file. The attached patch further adds
> `except` values where needed.

New description:

 The following text currently occurs in
 `$SAGE_ROOT/devel/sage/sage/graphs/base/c_graph.pyx`:

 {{{
 #!python
         # The following is due to a hard to reproduce bug in Cython where
 except,
         # cpdef, and classes don't play well together:
         print "Not Implemented!"
         # raise NotImplementedError() ... results in:
         # Exception exceptions.NotImplementedError: NotImplementedError()
 in 'sage.graphs.base.c_graph.CGraph.has_arc' ignored
         # False
 }}}

 There is no Cython bug, it's just a matter of properly declaring the
 `except` value in the `.pxd` file (not just the `.pyx` file). The attached
 patch further adds `except` values to some other functions where needed.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/11945#comment:8>
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/d/optout.

Reply via email to