Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 07/28] python-utils-r1.eclass: Deprecated and EAPI8-ban python_is_python3
Date: Sun, 20 Jun 2021 09:58:36
Message-Id: 20210620095552.625633-8-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/28] python-r1 suite EAPI 8 support/cleanup by "Michał Górny"
1 There is no use for python_is_python3 anymore, as Python 2 is no longer
2 supported at runtime and the remaining any-r1 uses are pure-2.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 eclass/python-utils-r1.eclass | 3 +++
7 eclass/tests/python-utils-r1.sh | 4 ++++
8 2 files changed, 7 insertions(+)
9
10 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
11 index 1ff794ede1de..a3d5770b7c08 100644
12 --- a/eclass/python-utils-r1.eclass
13 +++ b/eclass/python-utils-r1.eclass
14 @@ -1015,6 +1015,9 @@ _python_wrapper_setup() {
15 #
16 # Returns 0 (true) if it is, 1 (false) otherwise.
17 python_is_python3() {
18 + eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported anymore"
19 + [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}"
20 +
21 local impl=${1:-${EPYTHON}}
22 [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
23
24 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
25 index 85a6a53654d3..63a94c90b715 100755
26 --- a/eclass/tests/python-utils-r1.sh
27 +++ b/eclass/tests/python-utils-r1.sh
28 @@ -5,6 +5,10 @@
29 EAPI=7
30 source tests-common.sh
31
32 +eqawarn() {
33 + : # stub
34 +}
35 +
36 test_var() {
37 local var=${1}
38 local impl=${2}
39 --
40 2.32.0