Skip to content

Commit

Permalink
Trac #25978: Python 3: sorting issue causing failure in koszul_comple…
Browse files Browse the repository at this point in the history
…x.py

A sorting issue (`TypeError: '>' not supported between instances of
'NoneType' and 'int'`) in `multi_polynomial_ring_base.pyx` causes a
doctest failure in `koszul_complex.py` in Python 3.

URL: https://trac.sagemath.org/25978
Reported by: jhpalmieri
Ticket author(s): John Palmieri
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Sep 1, 2018
2 parents 8d959fd + 4a6ff4e commit b327098
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sage/rings/polynomial/multi_polynomial_ring_base.pyx
Expand Up @@ -938,7 +938,10 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):

counts, total = self._precomp_counts(n, degree)

if terms > total:
# Note that 'terms' could be None while 'total' is a
# nonnegative integer, so the comparison 'terms > total' could
# fail in Python 3.
if terms and terms > total:
terms = total

if terms is None:
Expand Down

0 comments on commit b327098

Please sign in to comment.