diff --git a/tools/python/pizza/log.py b/tools/python/pizza/log.py
index 7020c218a1d79c4ab34dc3e3698a5eb9f3841684..04c896c60b21b29c4f1937a7751cfb11cf92071a 100644
--- a/tools/python/pizza/log.py
+++ b/tools/python/pizza/log.py
@@ -270,7 +270,9 @@ class log:
 
       s1 = txt.find(self.firststr,start)
       s2 = txt.find("Loop time of",start+1)
-
+      if s2 == -1:
+        s2 = txt.find("ERROR",start+1)
+        
       if s1 >= 0 and s2 >= 0 and s1 < s2:    # found s1,s2 with s1 before s2
         if self.style == 2:
 	  s1 = txt.find("\n",s1) + 1
@@ -294,6 +296,9 @@ class log:
         if txt.find("Loop time of",start) == start:   # end of file, so exit
 	  eof -= len(txt) - start                     # reset eof to "Loop"
 	  break
+        if txt.find("ERROR",start) == start:          # end of file, so exit
+	  eof -= len(txt) - start                     # reset eof to "ERROR"
+	  break
 
 	last = 1                                      # entire read is a chunk
         s1 = 0
@@ -319,7 +324,6 @@ class log:
           word2 = re.findall(pat2,section)
           words = word1 + word2
           self.data.append(map(float,words))
-
       else:
         lines = chunk.split("\n")
         for line in lines: