[PATCH 1/3] Remove Python 2 workaround

Matt Turner <[email protected]> Thu, 4 Mar 2021 14:23:45 -0500
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
Signed-off-by: Matt Turner <[email protected]>
---
 lib/portage/__init__.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 184db6ae2..1d202f557 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -484,11 +484,7 @@ def _eapi_is_deprecated(eapi):
 	return eapi in _deprecated_eapis
 
 def eapi_is_supported(eapi):
-	if not isinstance(eapi, str):
-		# Only call str() when necessary since with python2 it
-		# can trigger UnicodeEncodeError if EAPI is corrupt.
-		eapi = str(eapi)
-	eapi = eapi.strip()
+	eapi = str(eapi).strip()
 
 	return eapi in _supported_eapis
 
-- 
2.26.2