From 3a8167567e4f7f938da9c34ca0a02ea2eac8de65 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 23 Oct 2019 12:08:27 +0200 Subject: [PATCH] python-utils-r1.eclass: Fix python_optimize to take all of sys.path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure to append NUL to every path in sys.path, rather than using it as a separator between output entries. This fixes a bug when the last path entry was silently discarded, and the function stopped working with PyPy as a result. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index f8f51ecb694a..549dd5f2e56e 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -692,7 +692,7 @@ python_optimize() { if [[ ${f} == /* && -d ${D%/}${f} ]]; then set -- "${D%/}${f}" "${@}" fi - done < <("${PYTHON}" -c 'import sys; print("\0".join(sys.path))' || die) + done < <("${PYTHON}" -c 'import sys; print("".join(x + "\0" for x in sys.path))' || die) debug-print "${FUNCNAME}: using sys.path: ${*/%/;}" fi -- 2.26.2