tests/run-tests.py
changeset 28317 8de70574be2c
parent 28284 0fe00bdb2f4f
child 28397 98a1a9547bb1
--- a/tests/run-tests.py	Sun Feb 28 23:16:30 2016 -0500
+++ b/tests/run-tests.py	Sun Feb 28 23:21:28 2016 -0500
@@ -1138,14 +1138,13 @@
                     elif warnonly == 1: # Is "not yet" and line is warn only.
                         warnonly = 2 # Yes do warn.
                 break
-
-            # clean up any optional leftovers
-            while expected.get(pos, None):
-                el = expected[pos].pop(0)
-                if not el.endswith(b" (?)\n"):
-                    expected[pos].insert(0, el)
-                    break
-                postout.append(b'  ' + el)
+            else:
+                # clean up any optional leftovers
+                while expected.get(pos, None):
+                    el = expected[pos].pop(0)
+                    if el and not el.endswith(b" (?)\n"):
+                        break
+                    postout.append(b'  ' + el)
 
             if lcmd:
                 # Add on last return code.