Skip to content

Commit

Permalink
Fixes #5969 by adding and using argument bare to function do_py
Browse files Browse the repository at this point in the history
  • Loading branch information
notEvil committed Oct 11, 2023
1 parent e45cc7a commit 6da5114
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from pipenv.vendor.click import (
Choice,
argument,
echo,
edit,
group,
option,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -758,7 +759,7 @@ def requirements(
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] "
Expand All @@ -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()

0 comments on commit 6da5114

Please sign in to comment.