]> granicus.if.org Git - python/commitdiff
If the input line does not contain enough fields, raise a meaningful
authorFred Drake <fdrake@acm.org>
Tue, 29 May 2001 15:25:51 +0000 (15:25 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 29 May 2001 15:25:51 +0000 (15:25 +0000)
error.

Doc/tools/refcounts.py

index 90f47d061db4dd70071b58211db3fd3ffaa24481..d7c761b41e22c3ce8b3304741cdfa4c2201e3049 100644 (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