Fixes #5969 by adding and using argument bare to function do_py

This commit is contained in:
notEvil
2023-10-11 09:21:24 +02:00
parent e45cc7a9ab
commit 6da5114922
+5 -3
View File
@@ -27,6 +27,7 @@ from pipenv.utils.processes import subprocess_run
from pipenv.vendor.click import (
Choice,
argument,
echo,
edit,
group,
option,
@@ -125,7 +126,7 @@ def cli(
do_where(state.project, bare=True)
return 0
elif py:
do_py(state.project, ctx=ctx)
do_py(state.project, ctx=ctx, bare=True)
return 0
# --support was passed...
elif support:
@@ -758,7 +759,7 @@ if __name__ == "__main__":
cli()
def do_py(project, ctx=None, system=False):
def do_py(project, ctx=None, system=False, bare=False):
if not project.virtualenv_exists:
err.print(
"[red]No virtualenv has been created for this project[/red] "
@@ -768,6 +769,7 @@ def do_py(project, ctx=None, system=False):
ctx.abort()
try:
console.print(project._which("python", allow_global=system))
(echo if bare else console.print)(project._which("python", allow_global=system))
except AttributeError:
console.print("No project found!", style="red")
ctx.abort()