mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Fixes #5969 by adding and using argument bare to function do_py
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user