diff options
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r-- | pym/portage/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 69533c7c0..0e26acbc8 100644 --- 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 |