Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5969.behavior.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change ``--py`` to use ``print`` preventing insertion of newline characters
7 changes: 4 additions & 3 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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 +758,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 +768,7 @@ def do_py(project, ctx=None, system=False):
ctx.abort()

try:
console.print(project._which("python", allow_global=system))
(print if bare else console.print)(project._which("python", allow_global=system))
except AttributeError:
console.print("No project found!", style="red")
ctx.abort()