Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 14 Sep 2021 17:57:06
Message-Id: 1631642145.be22deb1b7adc56ad559e0184a78d6aa4f614508.flow@gentoo
1 commit: be22deb1b7adc56ad559e0184a78d6aa4f614508
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 11 19:39:17 2021 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 14 17:55:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be22deb1
7
8 python-utils-r1.eclass: add and use _python_check_EPYTHON
9
10 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
11
12 eclass/python-utils-r1.eclass | 14 ++++++++++++--
13 1 file changed, 12 insertions(+), 2 deletions(-)
14
15 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
16 index 4fedf939c77..c729651699d 100644
17 --- a/eclass/python-utils-r1.eclass
18 +++ b/eclass/python-utils-r1.eclass
19 @@ -1250,6 +1250,16 @@ build_sphinx() {
20 HTML_DOCS+=( "${dir}/_build/html/." )
21 }
22
23 +# @FUNCTION: _python_check_EPYTHON
24 +# @INTERNAL
25 +# @DESCRIPTION:
26 +# Check if EPYTHON is set, die if not.
27 +_python_check_EPYTHON() {
28 + if [[ -z ${EPYTHON} ]]; then
29 + die "EPYTHON unset, invalid call context"
30 + fi
31 +}
32 +
33 # @VARIABLE: EPYTEST_DESELECT
34 # @DEFAULT_UNSET
35 # @DESCRIPTION:
36 @@ -1279,7 +1289,7 @@ build_sphinx() {
37 epytest() {
38 debug-print-function ${FUNCNAME} "${@}"
39
40 - [[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
41 + _python_check_EPYTHON
42
43 local args=(
44 # verbose progress reporting and tracebacks
45 @@ -1322,7 +1332,7 @@ epytest() {
46 eunittest() {
47 debug-print-function ${FUNCNAME} "${@}"
48
49 - [[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
50 + _python_check_EPYTHON
51
52 set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"