Skip to content

Commit

Permalink
Convert PipenvException to rich formatting
Browse files Browse the repository at this point in the history
Also, because we use rich.console we don't need the terminal
handling of click.
  • Loading branch information
oz123 committed Jul 13, 2024
1 parent 99255a6 commit b39111b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pipenv/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ def handle_exception(exc_type, exception, traceback, hook=sys.excepthook):
sys.excepthook = handle_exception


class PipenvException(ClickException):
message = "{}: {{}}".format(click.style("ERROR", fg="red", bold=True))
class PipenvException:
message = "[bold][red]ERROR[/red][/bold]: {}"

def __init__(self, message=None, **kwargs):
if not message:
message = "Pipenv encountered a problem and had to exit."
extra = kwargs.pop("extra", [])
message = self.message.format(message)
ClickException.__init__(self, message)
self.extra = extra

def show(self, file=None):
Expand Down

0 comments on commit b39111b

Please sign in to comment.