Make the eapi_is_supported() function use the generated list of
supported EAPIs rather than partial lists and integer comparison.
---
 pym/portage/__init__.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 18b2599..66bfeb0 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -505,19 +505,7 @@ def eapi_is_supported(eapi):
                eapi = str(eapi)
        eapi = eapi.strip()
 
-       if _eapi_is_deprecated(eapi):
-               return True
-
-       if eapi in _testing_eapis:
-               return True
-
-       try:
-               eapi = int(eapi)
-       except ValueError:
-               eapi = -1
-       if eapi < 0:
-               return False
-       return eapi <= portage.const.EAPI
+       return eapi in _supported_eapis
 
 # This pattern is specified by PMS section 7.3.1.
 _pms_eapi_re = re.compile(r"^[ \t]*EAPI=(['\"]?)([A-Za-z0-9+_.-]*)\1[ \t]*([ 
\t]#.*)?$")
-- 
2.0.4


Reply via email to