In shlex_split(), don't encode unicode for py3k. Thanks to Arfrever.
authorZac Medico <zmedico@gentoo.org>
Thu, 6 Aug 2009 22:39:16 +0000 (22:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 6 Aug 2009 22:39:16 +0000 (22:39 -0000)
svn path=/main/trunk/; revision=13942

pym/portage/util.py

index df66723ecade82b3a516a3bdc4743e1a9aeb59f8..780c9b5f16f458af74cd08aad7d0d38e0ede5a5e 100644 (file)
@@ -355,7 +355,7 @@ def shlex_split(s):
        This is equivalent to shlex.split but it temporarily encodes unicode
        strings to bytes since shlex.split() doesn't handle unicode strings.
        """
-       is_unicode = isinstance(s, unicode)
+       is_unicode = sys.hexversion < 0x3000000 and isinstance(s, unicode)
        if is_unicode:
                s = s.encode('utf_8', 'replace')
        rval = shlex.split(s)