[bugfix] Trying to fix a race condition that happens on empty graphs sometimes, on some computers.

This commit is contained in:
Romain Dorgueil
2017-10-29 23:32:34 +01:00
parent 06dc6b6e35
commit ba9f7171d4

View File

@ -52,6 +52,9 @@ class ConsoleOutputPlugin(Plugin):
def __init__(self, context): def __init__(self, context):
super(ConsoleOutputPlugin, self).__init__(context) super(ConsoleOutputPlugin, self).__init__(context)
self._reset()
def _reset()
self.prefix = '' self.prefix = ''
self.counter = 0 self.counter = 0
self._append_cache = '' self._append_cache = ''
@ -59,6 +62,7 @@ class ConsoleOutputPlugin(Plugin):
self.iswindows = (sys.platform == 'win32') self.iswindows = (sys.platform == 'win32')
def initialize(self): def initialize(self):
self._reset()
self._stdout = sys.stdout self._stdout = sys.stdout
self.stdout = IOBuffer() self.stdout = IOBuffer()
self.redirect_stdout = redirect_stdout(self._stdout if self.iswindows else self.stdout) self.redirect_stdout = redirect_stdout(self._stdout if self.iswindows else self.stdout)