From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C4DD113838B for ; Thu, 11 Sep 2014 23:45:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3A6A5E0938; Thu, 11 Sep 2014 23:45:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 83E63E0934 for ; Thu, 11 Sep 2014 23:45:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 93AF333FAD7 for ; Thu, 11 Sep 2014 23:45:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E4ABC5400 for ; Thu, 11 Sep 2014 23:45:22 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1410479065.6cde2a4d4232d92cb42490784d7798bc56767967.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/__init__.py X-VCS-Directories: pym/portage/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 6cde2a4d4232d92cb42490784d7798bc56767967 X-VCS-Branch: master Date: Thu, 11 Sep 2014 23:45:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a86813c5-bcc9-4a28-8a71-ee53f034c270 X-Archives-Hash: d00f234101084b5af8367c5d5a5c36f6 commit: 6cde2a4d4232d92cb42490784d7798bc56767967 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 17 18:58:42 2014 +0000 Commit: Brian Dolbec gmail 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]#.*)?$")