commit:     b67fe2372bcd92671125d9fb6220c9e6cdde9572
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 20 08:39:05 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 20 08:40:00 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b67fe237

dev-python/pip: Fix generating completions with vendored distutils

Closes: https://bugs.gentoo.org/823844
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pip/pip-21.3.1-r1.ebuild | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dev-python/pip/pip-21.3.1-r1.ebuild 
b/dev-python/pip/pip-21.3.1-r1.ebuild
index 20a768f303ee..f9f4baf6b0ee 100644
--- a/dev-python/pip/pip-21.3.1-r1.ebuild
+++ b/dev-python/pip/pip-21.3.1-r1.ebuild
@@ -133,12 +133,12 @@ python_install_all() {
        # 'pip completion' command embeds full $0 into completion script, which 
confuses
        # 'complete' and causes QA warning when running as "${PYTHON} -m pip".
        # This trick sets correct $0 while still calling just installed pip.
-       local pipcmd='import sys; sys.argv[0] = "pip"; from 
pip._internal.cli.main import main; sys.exit(main())'
+       local pipcmd='import sys; sys.argv[0] = "pip"; __file__ = ""; from 
pip._internal.cli.main import main; sys.exit(main())'
 
-       ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die
+       "${EPYTHON}" -c "${pipcmd}" completion --bash > "${COMPLETION}" || die
        newbashcomp "${COMPLETION}" ${PN}
 
-       ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die
+       "${EPYTHON}" -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die
        insinto /usr/share/zsh/site-functions
        newins "${COMPLETION}" _pip
 }

Reply via email to