commit: 6cde2a4d4232d92cb42490784d7798bc56767967 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sun Aug 17 18:58:42 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Thu Sep 11 23:44:25 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6cde2a4d
Make eapi_is_supported() reuse _supported_eapis list 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]#.*)?$")