##// END OF EJS Templates
flush on newline in subprocesses...
MinRK -
Show More
@@ -90,6 +90,7 b' class OutStream(object):'
90 return MASTER
90 return MASTER
91 else:
91 else:
92 if not self._have_pipe_out():
92 if not self._have_pipe_out():
93 self._flush_buffer()
93 # setup a new out pipe
94 # setup a new out pipe
94 self._setup_pipe_out()
95 self._setup_pipe_out()
95 return CHILD
96 return CHILD
@@ -174,8 +175,15 b' class OutStream(object):'
174 # Make sure that we're handling unicode
175 # Make sure that we're handling unicode
175 if not isinstance(string, unicode):
176 if not isinstance(string, unicode):
176 string = string.decode(self.encoding, 'replace')
177 string = string.decode(self.encoding, 'replace')
178
179 is_child = (self._check_mp_mode() == CHILD)
177 self._buffer.write(string)
180 self._buffer.write(string)
178 self._check_mp_mode()
181 if is_child:
182 # newlines imply flush in subprocesses
183 # mp.Pool cannot be trusted to flush promptly (or ever),
184 # and this helps.
185 if '\n' in string:
186 self.flush()
179 # do we want to check subprocess flushes on write?
187 # do we want to check subprocess flushes on write?
180 # self._flush_from_subprocesses()
188 # self._flush_from_subprocesses()
181 current_time = time.time()
189 current_time = time.time()
General Comments 0
You need to be logged in to leave comments. Login now