File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2160,13 +2160,13 @@ cdef class Polynomial(CommutativePolynomial):
2160
2160
sage: r^2 + r
2161
2161
a^2 + a
2162
2162
2163
- Check for :issue:`37034` ::
2163
+ Check for :issue:`37034`::
2164
2164
2165
2165
sage: R.<x> = Zmod(55)[]
2166
2166
sage: (x^2 + 1).any_root()
2167
2167
Traceback (most recent call last):
2168
2168
...
2169
- ValueError: ...
2169
+ ValueError: no roots (non-field) x^2 + 1
2170
2170
"""
2171
2171
if self .base_ring().is_finite() and self .base_ring().is_field():
2172
2172
if self .degree() < 0 :
@@ -2320,9 +2320,10 @@ cdef class Polynomial(CommutativePolynomial):
2320
2320
else :
2321
2321
return (self // h).any_root(ring, - degree, True )
2322
2322
else :
2323
- if (rs := self .roots(ring = ring, multiplicities = False )):
2323
+ rs = self .roots(ring = ring, multiplicities = False )
2324
+ if rs:
2324
2325
return rs[0 ]
2325
- raise ValueError (" no roots G %s " % self )
2326
+ raise ValueError (" no roots (non-field) %s " % self )
2326
2327
2327
2328
def __truediv__ (left , right ):
2328
2329
r """
You can’t perform that action at this time.
0 commit comments