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/
Date: Fri, 25 Feb 2022 15:53:17
Message-Id: 1645804387.025a6339ffc6f52ac78793b43d0cda01e5c35108.mgorny@gentoo
1 commit: 025a6339ffc6f52ac78793b43d0cda01e5c35108
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 22 07:26:04 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 25 15:53:07 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=025a6339
7
8 distutils-r1.eclass: Make build-backend getting more reliable
9
10 Protect build-backend getter against stray output to stdout.
11
12 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
13
14 eclass/distutils-r1.eclass | 6 ++++--
15 1 file changed, 4 insertions(+), 2 deletions(-)
16
17 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
18 index f6c797a9684e..d95b9525db40 100644
19 --- a/eclass/distutils-r1.eclass
20 +++ b/eclass/distutils-r1.eclass
21 @@ -939,10 +939,12 @@ _distutils-r1_get_backend() {
22 # if pyproject.toml exists, try getting the backend from it
23 # NB: this could fail if pyproject.toml doesn't list one
24 build_backend=$(
25 - "${EPYTHON}" - <<-EOF 2>/dev/null
26 + "${EPYTHON}" - 3>&1 &>/dev/null <<-EOF
27 + import os
28 import tomli
29 print(tomli.load(open("pyproject.toml", "rb"))
30 - ["build-system"]["build-backend"])
31 + ["build-system"]["build-backend"],
32 + file=os.fdopen(3, "w"))
33 EOF
34 )
35 fi