Fix portage._unicode_func_wrapper.__call__() to properly handle bytes with Python 3.
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Mon, 21 Sep 2009 17:00:59 +0000 (17:00 -0000)
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Mon, 21 Sep 2009 17:00:59 +0000 (17:00 -0000)
svn path=/main/trunk/; revision=14331

pym/portage/__init__.py

index a5a16734eb1cca53d03340c122b9c4dc6966e445..04348654258696c3eadcb7eecce404ff0380e7ee 100644 (file)
@@ -189,8 +189,8 @@ class _unicode_func_wrapper(object):
 
                rval = self._func(*wrapped_args, **wrapped_kwargs)
 
-               if isinstance(rval, (basestring, list, tuple)):
-                       if isinstance(rval, basestring):
+               if isinstance(rval, (bytes, basestring, list, tuple)):
+                       if isinstance(rval, (bytes, basestring)):
                                rval = _unicode_decode(rval,
                                        encoding=encoding, errors='replace')
                        else: