Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 404ac97

Browse files
committed
If the input line does not contain enough fields, raise a meaningful
error.
1 parent fac312f commit 404ac97

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/tools/refcounts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def loadfile(fp):
3232
# blank lines and comments
3333
continue
3434
parts = string.split(line, ":", 4)
35+
if len(parts) != 5:
36+
raise ValueError("Not enough fields in " + `line`)
3537
function, type, arg, refcount, comment = parts
3638
if refcount == "null":
3739
refcount = None

0 commit comments

Comments
 (0)