From e6e102cc642e78cf9da55645c82f5bfe6eacb76d Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 28 Apr 2015 19:27:04 +0200 Subject: Fixed previous commit which was incomplete --- scripts/Expect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/Expect.py') diff --git a/scripts/Expect.py b/scripts/Expect.py index cc92aff163e..c367b5b63a9 100755 --- a/scripts/Expect.py +++ b/scripts/Expect.py @@ -18,6 +18,7 @@ import sys import threading import time import traceback +import types __all__ = ["Expect", "EOF", "TIMEOUT" ] @@ -133,7 +134,9 @@ class reader(threading.Thread): content = self._tbuf.getvalue() suppress = False for p in self._tracesuppress: - if p.search(content): + if isinstance(p, types.LambdaType) or isinstance(p, types.FunctionType): + content = p(content) + elif p.search(content): suppress = True break if not suppress: -- cgit v1.2.3