protect against numbers that do not have any numbers
This commit is contained in:
parent
77dc6a2fc8
commit
42d241d89e
|
@ -8,8 +8,8 @@ def get_no_as_int(i):
|
|||
if i:
|
||||
if ' ' in i:
|
||||
try:
|
||||
return int(re.match('\d+', i).group())
|
||||
except ValueError:
|
||||
return int(re.match('\d+', i.strip()).group())
|
||||
except (ValueError, AttributeError):
|
||||
return 99999
|
||||
try:
|
||||
return int(i.split('-')[0])
|
||||
|
|
Reference in New Issue