From a1fe8d7c40eb3decb667ecb14f7ef584d7bffe55 Mon Sep 17 00:00:00 2001 From: Sangmin Yoon Date: Mon, 27 May 2024 16:31:03 +0900 Subject: [PATCH] Apply feedbacks --- pipenv/utils/virtualenv.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pipenv/utils/virtualenv.py b/pipenv/utils/virtualenv.py index 943b589fd0..be0ff0e368 100644 --- a/pipenv/utils/virtualenv.py +++ b/pipenv/utils/virtualenv.py @@ -241,18 +241,11 @@ def abort(msg=""): if python: range_pattern = r"^[<>]=?|!=" if re.search(range_pattern, python): - click.echo( - "{}: Python version range specifier '{}' is not supported. {}".format( - click.style("Error", fg="red", bold=True), - click.style(python, fg="cyan"), - click.style( - "Please use an absolute version number or specify the path to the Python executable on Pipfile.", - fg="yellow", - ), - ), - err=True, + err.print( + f"[bold red]Error[/bold red]: Python version range specifier '[cyan]{python}[/cyan]' is not supported. " + "[yellow]Please use an absolute version number or specify the path to the Python executable on Pipfile.[/yellow]" ) - abort() + sys.exit(1) if not python: python = project.s.PIPENV_DEFAULT_PYTHON_VERSION