projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a8bc90
)
Fix breakage in _unicode_encode() for non-string types.
author
Zac Medico
<zmedico@gentoo.org>
Mon, 21 Sep 2009 14:47:40 +0000
(14:47 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Mon, 21 Sep 2009 14:47:40 +0000
(14:47 -0000)
svn path=/main/trunk/; revision=14323
pym/portage/__init__.py
patch
|
blob
|
history
diff --git
a/pym/portage/__init__.py
b/pym/portage/__init__.py
index e3fee8084214486b03b4e64c1c0ed222c24a37bf..fe696b6dc3a2b7a4c5ba279b89096c2321b2e7ae 100644
(file)
--- a/
pym/portage/__init__.py
+++ b/
pym/portage/__init__.py
@@
-142,7
+142,10
@@
if _encodings['merge'] is None:
def _unicode_encode(s, encoding=_encodings['content'],
errors='backslashreplace'):
- if not isinstance(s, bytes):
+ if sys.hexversion >= 0x3000000:
+ if isinstance(s, str):
+ s = s.encode(encoding, errors)
+ elif isinstance(s, unicode):
s = s.encode(encoding, errors)
return s