diff --git a/src/sage/libs/cypari2/gen.pyx b/src/sage/libs/cypari2/gen.pyx
index 5f0f5c9..0602dd2 100644
a
|
b
|
cdef class gen(gen_auto): |
946 | 946 | v[i] = self[j] |
947 | 947 | return v |
948 | 948 | |
949 | | ## there are no "out of bounds" problems |
950 | | ## for a polynomial or power series, so these go before |
951 | | ## bounds testing |
952 | 949 | if pari_type == t_POL: |
953 | | return self.polcoeff(n) |
| 950 | if 0 <= n <= self.poldegree(): |
| 951 | return self.polcoeff(n) |
| 952 | raise IndexError("index out of range") |
954 | 953 | |
955 | 954 | elif pari_type == t_SER: |
956 | 955 | bound = valp(self.g) + lg(self.g) - 2 |