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