diff options
author | 2022-02-22 08:26:04 +0100 | |
---|---|---|
committer | 2022-02-25 16:53:07 +0100 | |
commit | 025a6339ffc6f52ac78793b43d0cda01e5c35108 (patch) | |
tree | 5d3b1acb41d3c4ac37227eda8b0ac6c8e0b74ff4 /eclass/distutils-r1.eclass | |
parent | distutils-r1.eclass: Update the desc for PEP517 mode (diff) | |
download | gentoo-025a6339ffc6f52ac78793b43d0cda01e5c35108.tar.gz gentoo-025a6339ffc6f52ac78793b43d0cda01e5c35108.tar.bz2 gentoo-025a6339ffc6f52ac78793b43d0cda01e5c35108.zip |
distutils-r1.eclass: Make build-backend getting more reliable
Protect build-backend getter against stray output to stdout.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index f6c797a9684e..d95b9525db40 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -939,10 +939,12 @@ _distutils-r1_get_backend() { # if pyproject.toml exists, try getting the backend from it # NB: this could fail if pyproject.toml doesn't list one build_backend=$( - "${EPYTHON}" - <<-EOF 2>/dev/null + "${EPYTHON}" - 3>&1 &>/dev/null <<-EOF + import os import tomli print(tomli.load(open("pyproject.toml", "rb")) - ["build-system"]["build-backend"]) + ["build-system"]["build-backend"], + file=os.fdopen(3, "w")) EOF ) fi |