From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-527-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 64BBD1381F3
	for <garchives@archives.gentoo.org>; Wed, 21 Aug 2013 19:54:57 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D04A3E0A68;
	Wed, 21 Aug 2013 19:54:56 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 167B2E09CB
	for <gentoo-python@lists.gentoo.org>; Wed, 21 Aug 2013 19:54:56 +0000 (UTC)
Received: from pomiot.lan (77-254-183-247.adsl.inetia.pl [77.254.183.247])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 3B41133ECAE;
	Wed, 21 Aug 2013 19:54:54 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org,
	=?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH python-utils-r1 2/4] Use python_is_python3 in the eclass.
Date: Wed, 21 Aug 2013 21:54:24 +0200
Message-Id: <1377114866-2669-2-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.3.2
In-Reply-To: <20130821215352.3ba7a2af@gentoo.org>
References: <20130821215352.3ba7a2af@gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-python@lists.gentoo.org>
List-Help: <mailto:gentoo-python+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org>
List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org>
X-BeenThere: gentoo-python@gentoo.org
X-BeenThere: gentoo-python@lists.gentoo.org
X-Archives-Salt: 4a4d1539-2a68-4783-b4c9-efbf68ef90b3
X-Archives-Hash: 1d2490bc43a590eb602dd1057e7ddf53

---
 gx86/eclass/python-utils-r1.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass
index 00399d2..e798c8d 100644
--- a/gx86/eclass/python-utils-r1.eclass
+++ b/gx86/eclass/python-utils-r1.eclass
@@ -532,8 +532,8 @@ _python_rewrite_shebang() {
 			die "${FUNCNAME}: ${f} does not seem to have a valid shebang"
 		fi
 
-		if [[ ${from} == python2 && ${impl} == python3*
-				|| ${from} == python3 && ${impl} != python3* ]]; then
+		if [[ ${from} == python2 ]] && python_is_python3 "${impl}" \
+				|| [[ ${from} == python3 ]] && ! python_is_python3 "${impl}"; then
 			eerror "A file does have shebang not supporting requested impl:"
 			eerror "  file: ${f}"
 			eerror "  shebang: ${shebang}"
@@ -883,9 +883,9 @@ python_wrapper_setup() {
 		python_export "${impl}" EPYTHON PYTHON
 
 		local pyver
-		if [[ ${EPYTHON} == python3* ]]; then
+		if python_is_python3; then
 			pyver=3
-		else # includes pypy & jython
+		else
 			pyver=2
 		fi
 
-- 
1.8.3.2