diff options
-rw-r--r-- | pym/portage/util/digraph.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage/util/digraph.py b/pym/portage/util/digraph.py index 2849b8e2c..df024fb4b 100644 --- a/pym/portage/util/digraph.py +++ b/pym/portage/util/digraph.py @@ -4,6 +4,7 @@ __all__ = ['digraph'] from collections import deque +from portage import _unicode_decode from portage.util import writemsg class digraph(object): @@ -266,14 +267,18 @@ class digraph(object): def debug_print(self): def output(s): writemsg(s, noiselevel=-1) + # Use _unicode_decode() to force unicode format + # strings for python-2.x safety, ensuring that + # node.__unicode__() is used when necessary. for node in self.nodes: - output("%s " % (node,)) + output(_unicode_decode("%s ") % (node,)) if self.nodes[node][0]: output("depends on\n") else: output("(no children)\n") for child, priorities in self.nodes[node][0].items(): - output(" %s (%s)\n" % (child, priorities[-1],)) + output(_unicode_decode(" %s (%s)\n") % \ + (child, priorities[-1],)) def bfs(self, start, ignore_priority=None): if start not in self: |