empty lines trip up if i[-1]..., move within try: ... except: ...

This commit is contained in:
randomuser 2021-11-23 11:29:59 -06:00
parent cc4ae66345
commit 41565af01f
1 changed files with 2 additions and 2 deletions

View File

@ -53,9 +53,9 @@ class RecordCollection():
raise FileParsingError(f"error parsing '{i}'") raise FileParsingError(f"error parsing '{i}'")
else: else:
try:
if i[-1] != ":": if i[-1] != ":":
raise FileParsingError(f"colon must be on last character of '{i}'") raise FileParsingError(f"colon must be on last character of '{i}'")
try:
name = i.split(' ')[1][0:-1] name = i.split(' ')[1][0:-1]
except IndexError: except IndexError:
current = Record() current = Record()