Show More
@@ -159,7 +159,8 b' class BufferedGenerator(object):' | |||
|
159 | 159 | """ |
|
160 | 160 | |
|
161 | 161 | def __init__(self, source, buffer_size=65536, chunk_size=4096, |
|
162 |
starting_values= |
|
|
162 | starting_values=None, bottomless=False): | |
|
163 | starting_values = starting_values or [] | |
|
163 | 164 | |
|
164 | 165 | if bottomless: |
|
165 | 166 | maxlen = int(buffer_size / chunk_size) |
@@ -190,9 +191,9 b' class BufferedGenerator(object):' | |||
|
190 | 191 | elif self.worker.EOF.is_set(): |
|
191 | 192 | raise StopIteration |
|
192 | 193 | |
|
193 | def throw(self, type, value=None, traceback=None): | |
|
194 | def throw(self, exc_type, value=None, traceback=None): | |
|
194 | 195 | if not self.worker.EOF.is_set(): |
|
195 | raise type(value) | |
|
196 | raise exc_type(value) | |
|
196 | 197 | |
|
197 | 198 | def start(self): |
|
198 | 199 | self.worker.start() |
@@ -354,7 +355,7 b' class SubprocessIOChunker(object):' | |||
|
354 | 355 | _closed = False |
|
355 | 356 | |
|
356 | 357 | def __init__(self, cmd, inputstream=None, buffer_size=65536, |
|
357 |
chunk_size=4096, starting_values= |
|
|
358 | chunk_size=4096, starting_values=None, fail_on_stderr=True, | |
|
358 | 359 | fail_on_return_code=True, **kwargs): |
|
359 | 360 | """ |
|
360 | 361 | Initializes SubprocessIOChunker |
@@ -370,6 +371,7 b' class SubprocessIOChunker(object):' | |||
|
370 | 371 | exception if the return code is not 0. |
|
371 | 372 | """ |
|
372 | 373 | |
|
374 | starting_values = starting_values or [] | |
|
373 | 375 | if inputstream: |
|
374 | 376 | input_streamer = StreamFeeder(inputstream) |
|
375 | 377 | input_streamer.start() |
@@ -434,6 +436,7 b' class SubprocessIOChunker(object):' | |||
|
434 | 436 | # are doing some magic in between closing stdout and terminating the |
|
435 | 437 | # process and, as a result, we are not getting return code on "slow" |
|
436 | 438 | # systems. |
|
439 | result = None | |
|
437 | 440 | stop_iteration = None |
|
438 | 441 | try: |
|
439 | 442 | result = self.output.next() |
General Comments 0
You need to be logged in to leave comments.
Login now