summaryrefslogtreecommitdiff
path: root/scripts/Expect.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Expect.py')
-rwxr-xr-xscripts/Expect.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/scripts/Expect.py b/scripts/Expect.py
index 80fe0ae1ada..05a1558234e 100755
--- a/scripts/Expect.py
+++ b/scripts/Expect.py
@@ -101,18 +101,20 @@ class reader(threading.Thread):
def trace(self, c):
if self._trace:
- self._tbuf.write(c)
- if c == '\n':
- content = self._tbuf.getvalue()
- supress = False
- if self._tracesupress:
- for p in self._tracesupress:
- if p.search(content):
- supress = True
- break
- if not supress:
- sys.stdout.write(content)
- self._tbuf.truncate(0)
+ if self._tracesupress:
+ self._tbuf.write(c)
+ if c == '\n':
+ content = self._tbuf.getvalue()
+ supress = False
+ for p in self._tracesupress:
+ if p.search(content):
+ supress = True
+ break
+ if not supress:
+ sys.stdout.write(content)
+ self._tbuf.truncate(0)
+ else:
+ sys.stdout.write(c)
def enabletrace(self, supress = None):
self.cv.acquire()
@@ -279,7 +281,7 @@ class Expect (object):
if self.p is not None:
self.terminate()
- def expect(self, pattern, timeout = 10):
+ def expect(self, pattern, timeout = 20):
"""pattern is either a string, or a list of string regexp patterns.
timeout == None expect can block indefinitely.