Add periods to these exception messages.

This commit is contained in:
Ethan Dalool 2020-03-12 14:03:10 -07:00
parent f897abce11
commit 46487d7a31

View file

@ -105,13 +105,13 @@ def parsebytes(string):
matches = re.findall(r'[\d\.-]+', string) matches = re.findall(r'[\d\.-]+', string)
if len(matches) == 0: if len(matches) == 0:
raise ValueError('No numbers found') raise ValueError('No numbers found.')
if len(matches) > 1: if len(matches) > 1:
raise ValueError('Too many numbers found') raise ValueError('Too many numbers found.')
byte_value = matches[0] byte_value = matches[0]
if not string.startswith(byte_value): if not string.startswith(byte_value):
raise ValueError('Number is not at start of string') raise ValueError('Number is not at start of string.')
# if the string has no text besides the number, just return that int. # if the string has no text besides the number, just return that int.
string = string.replace(byte_value, '') string = string.replace(byte_value, '')