Skip to content

Commit d6660cd

Browse files
committed
reviewer comments
1 parent 096daa7 commit d6660cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,13 +2160,13 @@ cdef class Polynomial(CommutativePolynomial):
21602160
sage: r^2 + r
21612161
a^2 + a
21622162
2163-
Check for :issue:`37034` ::
2163+
Check for :issue:`37034`::
21642164
21652165
sage: R.<x> = Zmod(55)[]
21662166
sage: (x^2 + 1).any_root()
21672167
Traceback (most recent call last):
21682168
...
2169-
ValueError: ...
2169+
ValueError: no roots (non-field) x^2 + 1
21702170
"""
21712171
if self.base_ring().is_finite() and self.base_ring().is_field():
21722172
if self.degree() < 0:
@@ -2320,9 +2320,10 @@ cdef class Polynomial(CommutativePolynomial):
23202320
else:
23212321
return (self//h).any_root(ring, -degree, True)
23222322
else:
2323-
if (rs := self.roots(ring=ring, multiplicities=False)):
2323+
rs = self.roots(ring=ring, multiplicities=False)
2324+
if rs:
23242325
return rs[0]
2325-
raise ValueError("no roots G %s" % self)
2326+
raise ValueError("no roots (non-field) %s" % self)
23262327

23272328
def __truediv__(left, right):
23282329
r"""

0 commit comments

Comments
 (0)