Skip to content

Commit e4ca82b

Browse files
committed
Remove compatibility code for legacy Windows CWD
1 parent 05dd345 commit e4ca82b

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/pip/_internal/cli/parser.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import textwrap
1010
from collections.abc import Generator
1111
from contextlib import suppress
12-
from typing import IO, Any, NoReturn
12+
from typing import Any, NoReturn
1313

14-
from pip._vendor.rich.console import Console, RenderableType, detect_legacy_windows
14+
from pip._vendor.rich.console import Console, RenderableType
1515
from pip._vendor.rich.markup import escape
1616
from pip._vendor.rich.style import StyleType
1717
from pip._vendor.rich.text import Text
@@ -244,22 +244,6 @@ def option_list_all(self) -> list[optparse.Option]:
244244

245245
return res
246246

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-
263247

264248
class ConfigOptionParser(CustomOptionParser):
265249
"""Custom option parser which updates its defaults by checking the

0 commit comments

Comments
 (0)