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