From ba9f7171d4487b25f886e9340130dd8bcb82134e Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Sun, 29 Oct 2017 23:32:34 +0100 Subject: [PATCH] [bugfix] Trying to fix a race condition that happens on empty graphs sometimes, on some computers. --- bonobo/ext/console.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bonobo/ext/console.py b/bonobo/ext/console.py index 577b345..da84592 100644 --- a/bonobo/ext/console.py +++ b/bonobo/ext/console.py @@ -52,6 +52,9 @@ class ConsoleOutputPlugin(Plugin): def __init__(self, context): super(ConsoleOutputPlugin, self).__init__(context) + self._reset() + + def _reset() self.prefix = '' self.counter = 0 self._append_cache = '' @@ -59,6 +62,7 @@ class ConsoleOutputPlugin(Plugin): self.iswindows = (sys.platform == 'win32') def initialize(self): + self._reset() self._stdout = sys.stdout self.stdout = IOBuffer() self.redirect_stdout = redirect_stdout(self._stdout if self.iswindows else self.stdout)