From eaa7b327ac17c3357e26010e927c74d4510b5b63 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 11 Jul 2010 13:58:19 -0700 Subject: [PATCH] Use writemsg_stdout instead of print, for unicode safety. --- pym/_emerge/actions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index ff443d792..a379af8c4 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -35,7 +35,8 @@ good = create_color_func("GOOD") bad = create_color_func("BAD") from portage.sets import load_default_config, SETPREFIX from portage.sets.base import InternalPackageSet -from portage.util import cmp_sort_key, writemsg, writemsg_level +from portage.util import cmp_sort_key, writemsg, \ + writemsg_level, writemsg_stdout from portage._global_updates import _global_updates from _emerge.clear_caches import clear_caches @@ -1309,9 +1310,11 @@ def action_info(settings, trees, myopts, myfiles): if versions: versions = ", ".join(ver.toString() for ver in versions) - print("%-20s %s" % (x+":", versions)) + writemsg_stdout("%-20s %s\n" % (x+":", versions), + noiselevel=-1) else: - print("%-20s %s" % (x+":", "[NOT VALID]")) + writemsg_stdout("%-20s %s\n" % (x+":", "[NOT VALID]"), + noiselevel=-1) libtool_vers = ",".join(trees["/"]["vartree"].dbapi.match("sys-devel/libtool")) @@ -1338,10 +1341,7 @@ def action_info(settings, trees, myopts, myfiles): for x in myvars: if x in settings: if x != "USE": - try: - print('%s="%s"' % (x, settings[x])) - except UnicodeEncodeError: - print('%s=' % (x, repr(settings[x]))) + writemsg_stdout('%s="%s"\n' % (x, settings[x]), noiselevel=-1) else: use = set(settings["USE"].split()) for varname in use_expand: -- 2.26.2