Skip to content

Commit bc38798

Browse files
yyyyx4vincentmacri
andauthored
ValueError instead of assertion failure (from review)
Co-authored-by: Vincent Macri <[email protected]>
1 parent a41b09c commit bc38798

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sage/schemes/elliptic_curves/addition_formulas_ring.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ def add(E, P, Q):
2929
a1, a2, a3, a4, a6 = E.a_invariants()
3030
b2, b4, b6, b8 = E.b_invariants()
3131

32-
assert P in E
33-
assert Q in E
32+
if P not in E:
33+
raise ValueError('P must be in E')
34+
if Q not in E:
35+
raise ValueError('Q must be in E')
3436
X1, Y1, Z1 = P
3537
X2, Y2, Z2 = Q
3638

0 commit comments

Comments
 (0)