Skip to content

Commit af00d01

Browse files
authored
Fix type annotation for AugmentedHelpFormatter (#6982)
This fixes a crash under mypyc. Closes #6980.
1 parent 0fdfdc7 commit af00d01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import time
88

9-
from typing import Dict, List, Optional, Tuple, TextIO
9+
from typing import Any, Dict, List, Optional, Tuple, TextIO
1010

1111
from mypy import build
1212
from mypy import defaults
@@ -124,7 +124,9 @@ class AugmentedHelpFormatter(argparse.RawDescriptionHelpFormatter):
124124
def __init__(self, prog: str) -> None:
125125
super().__init__(prog=prog, max_help_position=28)
126126

127-
def _fill_text(self, text: str, width: int, indent: int) -> str:
127+
# FIXME: typeshed incorrectly has the type of indent as int when
128+
# it should be str. Make it Any to avoid rusing mypyc.
129+
def _fill_text(self, text: str, width: int, indent: Any) -> str:
128130
if '\n' in text:
129131
# Assume we want to manually format the text
130132
return super()._fill_text(text, width, indent)

0 commit comments

Comments
 (0)