Skip to content

Commit

Permalink
Modify global rich.Console instance
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Apr 19, 2022
1 parent c247ddc commit 7115790
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/11045.bugfix.rst
@@ -0,0 +1 @@
Modify global ``rich.Console`` instance.
2 changes: 2 additions & 0 deletions src/pip/_internal/utils/logging.py
Expand Up @@ -10,6 +10,7 @@
from logging import Filter
from typing import Any, ClassVar, Generator, List, Optional, TextIO, Type

from pip._vendor.rich import reconfigure
from pip._vendor.rich.console import (
Console,
ConsoleOptions,
Expand Down Expand Up @@ -140,6 +141,7 @@ class RichPipStreamHandler(RichHandler):
KEYWORDS: ClassVar[Optional[List[str]]] = []

def __init__(self, stream: Optional[TextIO], no_color: bool) -> None:
reconfigure(no_color=no_color)
super().__init__(
console=Console(file=stream, no_color=no_color, soft_wrap=True),
show_time=False,
Expand Down

0 comments on commit 7115790

Please sign in to comment.