From: Zac Medico Date: Wed, 11 Mar 2009 05:56:33 +0000 (-0000) Subject: Decode terminal codes from binary when necessary, for python-3.0 compatibility X-Git-Tag: v2.1.6.8~157 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0ff34642ad42905cf9d28b39a12aa6d359f8fbca;p=portage.git Decode terminal codes from binary when necessary, for python-3.0 compatibility since sys.stdout is a text stream. (trunk r12649) svn path=/main/branches/2.1.6/; revision=12920 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 1e9553fc3..f5505d85a 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -9609,6 +9609,9 @@ class JobStatusDisplay(object): for k, capname in self._termcap_name_map.iteritems(): term_codes[k] = self._default_term_codes[capname] object.__setattr__(self, "_term_codes", term_codes) + for k, v in self._term_codes.items(): + if not isinstance(v, str): + self._term_codes[k] = v.decode() def _init_term(self): """