|
9 | 9 | import textwrap |
10 | 10 | from collections.abc import Generator |
11 | 11 | from contextlib import suppress |
12 | | -from typing import IO, Any, NoReturn |
| 12 | +from typing import Any, NoReturn |
13 | 13 |
|
14 | | -from pip._vendor.rich.console import Console, RenderableType, detect_legacy_windows |
| 14 | +from pip._vendor.rich.console import Console, RenderableType |
15 | 15 | from pip._vendor.rich.markup import escape |
16 | 16 | from pip._vendor.rich.style import StyleType |
17 | 17 | from pip._vendor.rich.text import Text |
@@ -244,22 +244,6 @@ def option_list_all(self) -> list[optparse.Option]: |
244 | 244 |
|
245 | 245 | return res |
246 | 246 |
|
247 | | - def _print_ansi(self, text: str, file: IO[str] | None = None) -> None: |
248 | | - if file is None: |
249 | | - file = sys.stdout |
250 | | - if detect_legacy_windows(): |
251 | | - console = Console(file=file) |
252 | | - console.print(Text.from_ansi(text), soft_wrap=True) |
253 | | - else: |
254 | | - file.write(text) |
255 | | - |
256 | | - def print_usage(self, file: IO[str] | None = None) -> None: |
257 | | - if self.usage: |
258 | | - self._print_ansi(self.get_usage(), file=file) |
259 | | - |
260 | | - def print_help(self, file: IO[str] | None = None) -> None: |
261 | | - self._print_ansi(self.format_help(), file=file) |
262 | | - |
263 | 247 |
|
264 | 248 | class ConfigOptionParser(CustomOptionParser): |
265 | 249 | """Custom option parser which updates its defaults by checking the |
|
0 commit comments