From 4b0248e3f3110f52222fffab67dac12f06b0cd66 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 18 Mar 2013 22:55:57 -0700 Subject: [PATCH] grabfile_package: unicode(), not str() for py2 --- pym/portage/util/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 5085a8bb9..32875695b 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -46,6 +46,11 @@ from portage.localization import _ from portage.proxy.objectproxy import ObjectProxy from portage.cache.mappings import UserDict +if sys.hexversion >= 0x3000000: + _unicode = str +else: + _unicode = unicode + noiselimit = 0 def initialize_logger(level=logging.WARN): @@ -463,7 +468,7 @@ def grabfile_package(myfilename, compatlevel=0, recursive=0, allow_wildcard=Fals writemsg(_("--- Invalid atom in %s: %s\n") % (source_file, e), noiselevel=-1) else: - if pkg_orig == str(pkg): + if pkg_orig == _unicode(pkg): # normal atom, so return as Atom instance if remember_source_file: atoms.append((pkg, source_file)) -- 2.26.2