Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 599af7f

Browse files
Remove useless parameter script_path of mypy.main() (#13399)
`script_path` was entirely useless since `bin_dir` had been dropped long time ago by #5690. This PR also makes arguments of mypy.main keyword-only.
1 parent 234b161 commit 599af7f

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

mypy/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def console_entry() -> None:
1111
try:
12-
main(None, sys.stdout, sys.stderr)
12+
main()
1313
sys.stdout.flush()
1414
sys.stderr.flush()
1515
except BrokenPipeError:

mypy/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def run(args: List[str]) -> Tuple[str, str, int]:
6767
from mypy.main import main
6868

6969
return _run(
70-
lambda stdout, stderr: main(None, args=args, stdout=stdout, stderr=stderr, clean_exit=True)
70+
lambda stdout, stderr: main(args=args, stdout=stdout, stderr=stderr, clean_exit=True)
7171
)
7272

7373

mypy/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ def stat_proxy(path: str) -> os.stat_result:
3939

4040

4141
def main(
42-
script_path: Optional[str],
43-
stdout: TextIO,
44-
stderr: TextIO,
42+
*,
4543
args: Optional[List[str]] = None,
44+
stdout: TextIO = sys.stdout,
45+
stderr: TextIO = sys.stderr,
4646
clean_exit: bool = False,
4747
) -> None:
4848
"""Main entry point to the type checker.
4949
5050
Args:
51-
script_path: Path to the 'mypy' script (used for finding data files).
5251
args: Custom command-line arguments. If not given, sys.argv[1:] will
5352
be used.
5453
clean_exit: Don't hard kill the process on exit. This allows catching

0 commit comments

Comments
 (0)