From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-526-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 57CA01381F3
	for <garchives@archives.gentoo.org>; Wed, 21 Aug 2013 19:54:55 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E7095E0DF7;
	Wed, 21 Aug 2013 19:54:54 +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 7FEA1E0DF7
	for <gentoo-python@lists.gentoo.org>; Wed, 21 Aug 2013 19:54:54 +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 A69CE33EC62;
	Wed, 21 Aug 2013 19:54:52 +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 1/4] Add python_is_python3().
Date: Wed, 21 Aug 2013 21:54:23 +0200
Message-Id: <1377114866-2669-1-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: 1d6df01a-00d2-4ffc-981a-7915ef593b1d
X-Archives-Hash: 03bf8bced93981037556325459d94d3e

To replace the checks with ones suitable for PyPy3.
---
 gx86/eclass/python-utils-r1.eclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass
index 5814a13..00399d2 100644
--- a/gx86/eclass/python-utils-r1.eclass
+++ b/gx86/eclass/python-utils-r1.eclass
@@ -942,5 +942,19 @@ __EOF__
 	fi
 }
 
+# @FUNCTION: python_is_python3
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Check whether <impl> (or ${EPYTHON}) is a Python3k variant
+# (i.e. uses syntax and stdlib of Python 3.*).
+#
+# Returns 0 (true) if it is, 1 (false) otherwise.
+python_is_python3() {
+	local impl=${1:-${EPYTHON}}
+	[[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
+
+	[[ ${impl} == python3* ]]
+}
+
 _PYTHON_UTILS_R1=1
 fi
-- 
1.8.3.2