Gentoo Archives: gentoo-portage-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-portage-dev] [PATCH 1/3] Remove Python 2 workaround
Date: Thu, 04 Mar 2021 19:23:58
Message-Id: 20210304192347.899796-1-mattst88@gentoo.org
1 Signed-off-by: Matt Turner <mattst88@g.o>
2 ---
3 lib/portage/__init__.py | 6 +-----
4 1 file changed, 1 insertion(+), 5 deletions(-)
5
6 diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
7 index 184db6ae2..1d202f557 100644
8 --- a/lib/portage/__init__.py
9 +++ b/lib/portage/__init__.py
10 @@ -484,11 +484,7 @@ def _eapi_is_deprecated(eapi):
11 return eapi in _deprecated_eapis
12
13 def eapi_is_supported(eapi):
14 - if not isinstance(eapi, str):
15 - # Only call str() when necessary since with python2 it
16 - # can trigger UnicodeEncodeError if EAPI is corrupt.
17 - eapi = str(eapi)
18 - eapi = eapi.strip()
19 + eapi = str(eapi).strip()
20
21 return eapi in _supported_eapis
22
23 --
24 2.26.2

Replies