Show More
@@ -370,14 +370,10 b' class partiterator(object):' | |||
|
370 | 370 | if not self.iterator: |
|
371 | 371 | return |
|
372 | 372 | |
|
373 | if exc: | |
|
374 | # If exiting or interrupted, do not attempt to seek the stream in | |
|
375 | # the finally block below. This makes abort faster. | |
|
376 | if (self.current and | |
|
377 | not isinstance(exc, (SystemExit, KeyboardInterrupt))): | |
|
378 | # consume the part content to not corrupt the stream. | |
|
379 | self.current.seek(0, 2) | |
|
380 | ||
|
373 | # Only gracefully abort in a normal exception situation. User aborts | |
|
374 | # like Ctrl+C throw a KeyboardInterrupt which is not a base Exception, | |
|
375 | # and should not gracefully cleanup. | |
|
376 | if isinstance(exc, Exception): | |
|
381 | 377 | # Any exceptions seeking to the end of the bundle at this point are |
|
382 | 378 | # almost certainly related to the underlying stream being bad. |
|
383 | 379 | # And, chances are that the exception we're handling is related to |
@@ -385,6 +381,10 b' class partiterator(object):' | |||
|
385 | 381 | # re-raise the original error. |
|
386 | 382 | seekerror = False |
|
387 | 383 | try: |
|
384 | if self.current: | |
|
385 | # consume the part content to not corrupt the stream. | |
|
386 | self.current.seek(0, 2) | |
|
387 | ||
|
388 | 388 | for part in self.iterator: |
|
389 | 389 | # consume the bundle content |
|
390 | 390 | part.seek(0, 2) |
General Comments 0
You need to be logged in to leave comments.
Login now