emaint: cleanup TaskHandler isatty logic
diff --git a/pym/portage/emaint/main.py b/pym/portage/emaint/main.py
index dbc5f18..5775ce1 100644
--- a/pym/portage/emaint/main.py
+++ b/pym/portage/emaint/main.py
@@ -115,7 +115,7 @@
return
for task in tasks:
inst = task()
- show_progress = self.show_progress_bar
+ show_progress = self.show_progress_bar and self.isatty
# check if the function is capable of progressbar
# and possibly override it off
if show_progress and hasattr(inst, 'can_progressbar'):
@@ -133,7 +133,7 @@
'options': options.copy()
}
result = getattr(inst, func)(**kwargs)
- if self.isatty and show_progress:
+ if show_progress:
# make sure the final progress is displayed
self.progress_bar.display()
print()