diff options
-rw-r--r-- | pym/_emerge/EbuildPhase.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py index a5d617f65..fd010c059 100644 --- a/pym/_emerge/EbuildPhase.py +++ b/pym/_emerge/EbuildPhase.py @@ -219,8 +219,14 @@ class EbuildPhase(CompositeTask): out = StringIO() phase = self.phase elog_func = getattr(elog_messages, elog_funcname) - for line in lines: - elog_func(line, phase=phase, key=self.settings.mycpv, out=out) + global_havecolor = portage.output.havecolor + try: + portage.output.havecolor = \ + self.settings.get('NOCOLOR', 'false').lower() in ('no', 'false') + for line in lines: + elog_func(line, phase=phase, key=self.settings.mycpv, out=out) + finally: + portage.output.havecolor = global_havecolor msg = _unicode_decode(out.getvalue(), encoding=_encodings['content'], errors='replace') if msg: |