From: Zac Medico Date: Tue, 19 Mar 2013 05:55:57 +0000 (-0700) Subject: grabfile_package: unicode(), not str() for py2 X-Git-Tag: v2.2.0_alpha167~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b0248e3f3110f52222fffab67dac12f06b0cd66;p=portage.git grabfile_package: unicode(), not str() for py2 --- 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))