Skip to content

Commit 2f2b23f

Browse files
authored
Merge pull request #114 from cs50/OverflowError
handles OverflowError in get_float
2 parents af0dea3 + f985b42 commit 2f2b23f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
package_dir={"": "src"},
1717
packages=["cs50"],
1818
url="https://github.com/cs50/python-cs50",
19-
version="5.0.3"
19+
version="5.0.4"
2020
)

src/cs50/cs50.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_float(prompt):
8080
if len(s) > 0 and re.search(r"^[+-]?\d*(?:\.\d*)?$", s):
8181
try:
8282
return float(s)
83-
except ValueError:
83+
except (OverflowError, ValueError):
8484
pass
8585

8686

0 commit comments

Comments
 (0)