projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fec3573
)
Bug #296641 - Avoid UnicodeEncodeError with python2 in eapi_is_supported()
author
Zac Medico
<zmedico@gentoo.org>
Sun, 13 Dec 2009 03:54:53 +0000
(
03:54
-0000)
committer
Zac Medico
<zmedico@gentoo.org>
Sun, 13 Dec 2009 03:54:53 +0000
(
03:54
-0000)
triggered by corrupt EAPI. (trunk r15055)
svn path=/main/branches/2.1.7/; revision=15088
pym/portage/__init__.py
patch
|
blob
|
history
diff --git
a/pym/portage/__init__.py
b/pym/portage/__init__.py
index 8b5e89bb768c8c5420fa30ef171b269efbb05097..4846b3ae434ec2b88d6cbd4674a12070ad9f467d 100644
(file)
--- a/
pym/portage/__init__.py
+++ b/
pym/portage/__init__.py
@@
-6080,7
+6080,11
@@
def _eapi_is_deprecated(eapi):
return eapi in _deprecated_eapis
def eapi_is_supported(eapi):
- eapi = str(eapi).strip()
+ if not isinstance(eapi, basestring):
+ # Only call str() when necessary since with python2 it
+ # can trigger UnicodeEncodeError if EAPI is corrupt.
+ eapi = str(eapi)
+ eapi = eapi.strip()
if _eapi_is_deprecated(eapi):
return True