Skip to content

Commit 919eb9c

Browse files
author
Release Manager
committed
gh-37202: catch possible failure in random doctest when dimension of an ideal is 1 instead of 0 See [here](https://github.com/sagemath/sage/actions/runs/7715956934/job/ 21039012695?pr=37096#step:14:16): That ideal can have dimension $1$ instead of $0$ in rare cases, which causes the doctest to fail very occasionally. URL: #37202 Reported by: Lorenz Panny Reviewer(s): Travis Scrimshaw
2 parents c01ed87 + e39b725 commit 919eb9c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sage/schemes/elliptic_curves/ell_finite_field.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,12 @@ def twists(self):
17881788
sage: eq = 1728*4*A**3 - j * (4*A**3 + 27*B**2)
17891789
sage: twists2 = []
17901790
sage: for _ in range(10):
1791-
....: V = Ideal([eq, A + B - F.random_element()]).variety()
1791+
....: I = Ideal([eq, A + B - F.random_element()])
1792+
....: try:
1793+
....: V = I.variety()
1794+
....: except ValueError:
1795+
....: if I.dimension() == 0:
1796+
....: raise
17921797
....: if not V:
17931798
....: continue
17941799
....: sol = choice(V)

0 commit comments

Comments
 (0)