#17382: Show Cython code in IPython tracebacks
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.5
Component: packages: | Resolution:
standard | Merged in:
Keywords: | Reviewers: Travis Scrimshaw
Authors: Jeroen Demeyer | Work issues:
Report Upstream: Fixed upstream, | Commit:
but not in a stable release. | 6e7ad656ba3307ff67949e251550c101758f9963
Branch: | Stopgaps:
u/jdemeyer/ticket/17382 |
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by vbraun):
* status: positive_review => needs_work
Comment:
{{{
sage -t --long src/sage/repl/interpreter.py
**********************************************************************
File "src/sage/repl/interpreter.py", line 76, in sage.repl.interpreter
Failed example:
get_test_shell().run_cell('1/0')
Expected:
---------------------------------------------------------------------------
...
/usr/local/src/sage-git/src/sage/rings/integer_ring.pyx in
sage.rings.integer_ring.IntegerRing_class._div
(build/cythonized/sage/rings/integer_ring.c:...)()
... cdef rational.Rational x = PY_NEW(rational.Rational)
... if mpz_sgn(right.value) == 0:
... raise ZeroDivisionError('Rational division by
zero')
... mpz_set(mpq_numref(x.value), left.value)
... mpz_set(mpq_denref(x.value), right.value)
<BLANKLINE>
ZeroDivisionError: Rational division by zero
Got:
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call
last)
<ipython-input-1-6f88eab09598> in <module>()
----> 1 Integer(1)/Integer(0)
<BLANKLINE>
/home/release/Sage/src/sage/structure/element.pyx in
sage.structure.element.RingElement.__div__
(build/cythonized/sage/structure/element.c:17829)()
1889 return
(<RingElement>self)._idiv_(<RingElement>right)
1890 else:
-> 1891 return
(<RingElement>self)._div_(<RingElement>right)
1892 global coercion_model
1893 return coercion_model.bin_op(self, right, div)
<BLANKLINE>
/home/release/Sage/src/sage/rings/integer.pyx in
sage.rings.integer.Integer._div_
(build/cythonized/sage/rings/integer.c:12872)()
1792 # This is vastly faster than doing it here, since here
1793 # we can't cimport rationals.
-> 1794 return the_integer_ring._div(self, right)
1795
1796 def __floordiv__(x, y):
<BLANKLINE>
/home/release/Sage/src/sage/rings/integer_ring.pyx in
sage.rings.integer_ring.IntegerRing_class._div
(build/cythonized/sage/rings/integer_ring.c:4582)()
443 cdef rational.Rational x = PY_NEW(rational.Rational)
444 if mpz_sgn(right.value) == 0:
--> 445 raise ZeroDivisionError('Rational division by
zero')
446 mpz_set(mpq_numref(x.value), left.value)
447 mpz_set(mpq_denref(x.value), right.value)
<BLANKLINE>
ZeroDivisionError: Rational division by zero
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/17382#comment:13>
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.