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}'")
else:
if i[-1] != ":":
raise FileParsingError(f"colon must be on last character of '{i}'")
try:
if i[-1] != ":":
raise FileParsingError(f"colon must be on last character of '{i}'")
name = i.split(' ')[1][0:-1]
except IndexError:
current = Record()