Skip to content

Commit c476386

Browse files
hamdanalichard26
authored andcommitted
Fix annotations on python 3.7
1 parent e9b4880 commit c476386

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pip/_internal/cli/parser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
2828
"""A prettier/less verbose help formatter for optparse."""
2929

30-
styles: dict[str, StyleType] = {
30+
styles: Dict[str, StyleType] = {
3131
"optparse.args": "cyan",
3232
"optparse.groups": "dark_orange",
3333
"optparse.help": "default",
3434
"optparse.metavar": "dark_cyan",
3535
"optparse.syntax": "bold",
3636
"optparse.text": "default",
3737
}
38-
highlights: list[str] = [
38+
highlights: List[str] = [
3939
r"(?:^|\s)(?P<args>-{1,2}[\w]+[\w-]*)", # highlight --words-with-dashes as args
4040
r"`(?P<syntax>[^`]*)`", # highlight `text in backquotes` as syntax
4141
]
@@ -47,7 +47,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
4747
kwargs["width"] = shutil.get_terminal_size()[0] - 2
4848
super().__init__(*args, **kwargs)
4949
self.console: Console = Console(theme=Theme(self.styles))
50-
self.rich_option_strings: dict[optparse.Option, Text] = {}
50+
self.rich_option_strings: Dict[optparse.Option, Text] = {}
5151

5252
def stringify(self, text: RenderableType) -> str:
5353
"""Render a rich object as a string."""
@@ -118,7 +118,7 @@ def rich_expand_default(self, option: optparse.Option) -> Text:
118118

119119
def format_option(self, option: optparse.Option) -> str:
120120
# Overridden to call the rich methods.
121-
result: list[Text] = []
121+
result: List[Text] = []
122122
opts = self.rich_option_strings[option]
123123
opt_width = self.help_position - self.current_indent - 2
124124
if len(opts) > opt_width:
@@ -169,7 +169,7 @@ def store_option_strings(self, parser: optparse.OptionParser) -> None:
169169

170170
def rich_format_option_strings(self, option: optparse.Option) -> Text:
171171
# `HelpFormatter.format_option_strings()` equivalent that returns a `Text`.
172-
opts: list[Text] = []
172+
opts: List[Text] = []
173173

174174
if option._short_opts:
175175
opts.append(Text(option._short_opts[0], "optparse.args"))

0 commit comments

Comments
 (0)