projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7accf1a
)
Use ValueError, not Exception.
author
Scott Gasch
<
[email protected]
>
Sat, 24 Apr 2021 00:17:37 +0000
(17:17 -0700)
committer
Scott Gasch
<
[email protected]
>
Sat, 24 Apr 2021 00:17:37 +0000
(17:17 -0700)
math_utils.py
patch
|
blob
|
history
diff --git
a/math_utils.py
b/math_utils.py
index 2cacc2f628ee90761acdce30442cb3d1beb9f1de..2e126990fba0d7b9138f4a4b6238440aae89bb82 100644
(file)
--- a/
math_utils.py
+++ b/
math_utils.py
@@
-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