Use ValueError, not Exception.
authorScott Gasch <[email protected]>
Sat, 24 Apr 2021 00:17:37 +0000 (17:17 -0700)
committerScott Gasch <[email protected]>
Sat, 24 Apr 2021 00:17:37 +0000 (17:17 -0700)
math_utils.py

index 2cacc2f628ee90761acdce30442cb3d1beb9f1de..2e126990fba0d7b9138f4a4b6238440aae89bb82 100644 (file)
@@ -43,7 +43,7 @@ def gcd_floats(a: float, b: float) -> float:
 
 def gcd_float_sequence(lst: List[float]) -> float:
     if len(lst) <= 0:
-        raise Exception("Need at least one number")
+        raise ValueError("Need at least one number")
     elif len(lst) == 1:
         return lst[0]
     assert len(lst) >= 2