projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbe11e9
)
Add py3k support to _unicode_decode().
author
Zac Medico
<zmedico@gentoo.org>
Thu, 13 Aug 2009 19:34:07 +0000
(19:34 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Thu, 13 Aug 2009 19:34:07 +0000
(19:34 -0000)
svn path=/main/trunk/; revision=14016
pym/portage/__init__.py
patch
|
blob
|
history
diff --git
a/pym/portage/__init__.py
b/pym/portage/__init__.py
index b28a091cf42aa0f67eca5678e7454b9eab39b3da..79b0508c52785e6737777c730d6464ce3dd3f69d 100644
(file)
--- a/
pym/portage/__init__.py
+++ b/
pym/portage/__init__.py
@@
-123,8
+123,13
@@
def _unicode_encode(s):
return s
def _unicode_decode(s):
- if not isinstance(s, unicode) and isinstance(s, basestring):
- s = unicode(s, encoding='utf_8', errors='replace')
+ if not isinstance(s, unicode):
+ if sys.hexversion < 0x3000000:
+ if isinstance(s, basestring):
+ s = unicode(s, encoding='utf_8', errors='replace')
+ else:
+ if isinstance(s, bytes):
+ s = unicode(s, encoding='utf_8', errors='replace')
return s
class _unicode_func_wrapper(object):