If the input line does not contain enough fields, raise a meaningful

error.
This commit is contained in:
Fred Drake 2001-05-29 15:25:51 +00:00
parent fac312ff88
commit 404ac97207

View file

@ -32,6 +32,8 @@ def loadfile(fp):
# blank lines and comments
continue
parts = string.split(line, ":", 4)
if len(parts) != 5:
raise ValueError("Not enough fields in " + `line`)
function, type, arg, refcount, comment = parts
if refcount == "null":
refcount = None