Fix extra new line that break from progress bar
The new line should be writed to stdout only when there is a progress bar displayed. Change-Id: If0e62cd5a3734ed67d66d285267c101b7caeea77 Closes-Bug: #1253042
This commit is contained in:
@@ -58,8 +58,10 @@ class VerboseFileWrapper(_ProgressBarBase):
|
||||
if data:
|
||||
self._display_progress_bar(len(data))
|
||||
else:
|
||||
# Break to a new line from the progress bar for incoming output.
|
||||
sys.stdout.write('\n')
|
||||
if self._show_progress:
|
||||
# Break to a new line from the progress bar for incoming
|
||||
# output.
|
||||
sys.stdout.write('\n')
|
||||
return data
|
||||
|
||||
|
||||
@@ -82,6 +84,8 @@ class VerboseIteratorWrapper(_ProgressBarBase):
|
||||
self._display_progress_bar(len(data))
|
||||
return data
|
||||
except StopIteration:
|
||||
# Break to a new line from the progress bar for incoming output.
|
||||
sys.stdout.write('\n')
|
||||
if self._show_progress:
|
||||
# Break to a new line from the progress bar for incoming
|
||||
# output.
|
||||
sys.stdout.write('\n')
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user