diff --git a/tools/test.py b/tools/test.py
index e7c01c8658b23d..561473f246629b 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -1287,9 +1287,7 @@ def ReadConfigurationInto(path, sections, defs):
     if prefix_match:
       prefix = SplitPath(prefix_match.group(1).strip())
       continue
-    print "Malformed line: '%s'." % line
-    return False
-  return True
+    raise Exception("Malformed line: '%s'." % line)
 
 
 # ---------------