提交 25aa7a69 编写于 作者: L Lukáš Doktor

output: Support Paginator.flush

While debugging Avocado I noticed some crashes when attaching debugger.
It was caused by the debugger which force-flushes the STDOUT on some
occasions, which is usually supported, but is not supported by our
Paginator class. This commit adds the flush method which flushes the
output pipe (unless it's already closed)
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 5f6d9f01
......@@ -561,6 +561,10 @@ class Paginator(object):
except Exception:
pass
def flush(self):
if not self.pipe.closed:
self.pipe.flush()
def add_log_handler(logger, klass=logging.StreamHandler, stream=sys.stdout,
level=logging.INFO, fmt='%(name)s: %(message)s'):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册