commit: a0eb5847674c9d295fbc80e2b7c53855cfca5a66
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 07:14:32 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 23 21:44:08 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0eb5847
python-utils-r1.eclass: Deprecated and EAPI8-ban python_is_python3
There is no use for python_is_python3 anymore, as Python 2 is no longer
supported at runtime and the remaining any-r1 uses are pure-2.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
eclass/python-utils-r1.eclass | 3 +++
eclass/tests/python-utils-r1.sh | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1a20a3cae99..b435ebaa7ad 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1010,6 +1010,9 @@ _python_wrapper_setup() {
#
# Returns 0 (true) if it is, 1 (false) otherwise.
python_is_python3() {
+ eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported
anymore"
+ [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}"
+
local impl=${1:-${EPYTHON}}
[[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 85a6a53654d..63a94c90b71 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -5,6 +5,10 @@
EAPI=7
source tests-common.sh
+eqawarn() {
+ : # stub
+}
+
test_var() {
local var=${1}
local impl=${2}