Skip to content

Commit

Permalink
prevent infections from being annotation on invalid numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanathan committed Nov 29, 2018
1 parent 8ae2728 commit 41746fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions epitator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def parse_spelled_number(num_str):

def parse_count_text(count_text, verbose=False):
# verboseprint = print if verbose else lambda *a, **k: None
if count_text[0] == '0' and len(count_text) > 1:
return
try:
count = int(count_text)
except ValueError:
Expand All @@ -119,8 +121,7 @@ def parse_count_text(count_text, verbose=False):
count = parse_spelled_number(count_text)
except ValueError:
pass
if count is None:
# warning("count '{}' could not be parsed".format(count_text))
if count is None or int(count) != count:
return
else:
return(count)
Expand Down

0 comments on commit 41746fa

Please sign in to comment.