Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/, eclass/
Date: Wed, 23 Jun 2021 21:44:36
Message-Id: 1624484648.a0eb5847674c9d295fbc80e2b7c53855cfca5a66.mgorny@gentoo
1 commit: a0eb5847674c9d295fbc80e2b7c53855cfca5a66
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 20 07:14:32 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 23 21:44:08 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0eb5847
7
8 python-utils-r1.eclass: Deprecated and EAPI8-ban python_is_python3
9
10 There is no use for python_is_python3 anymore, as Python 2 is no longer
11 supported at runtime and the remaining any-r1 uses are pure-2.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 eclass/python-utils-r1.eclass | 3 +++
16 eclass/tests/python-utils-r1.sh | 4 ++++
17 2 files changed, 7 insertions(+)
18
19 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
20 index 1a20a3cae99..b435ebaa7ad 100644
21 --- a/eclass/python-utils-r1.eclass
22 +++ b/eclass/python-utils-r1.eclass
23 @@ -1010,6 +1010,9 @@ _python_wrapper_setup() {
24 #
25 # Returns 0 (true) if it is, 1 (false) otherwise.
26 python_is_python3() {
27 + eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported anymore"
28 + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}"
29 +
30 local impl=${1:-${EPYTHON}}
31 [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
32
33
34 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
35 index 85a6a53654d..63a94c90b71 100755
36 --- a/eclass/tests/python-utils-r1.sh
37 +++ b/eclass/tests/python-utils-r1.sh
38 @@ -5,6 +5,10 @@
39 EAPI=7
40 source tests-common.sh
41
42 +eqawarn() {
43 + : # stub
44 +}
45 +
46 test_var() {
47 local var=${1}
48 local impl=${2}