Skip to content

Commit

Permalink
stubtest: correct type annotations in _Arguments (#16897)
Browse files Browse the repository at this point in the history
Two fields in the `_Arguments` class, `mypy_config_file` and
`custom_typeshed_dir`, can take on a None value, but they are not marked
as such. Calling `stubtest.parse_options` on an empty list of arguments
reproduces the situation where these two fields are None.
  • Loading branch information
sam-xif committed Feb 11, 2024
1 parent 996544f commit 837f7e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,8 @@ class _Arguments:
allowlist: list[str]
generate_allowlist: bool
ignore_unused_allowlist: bool
mypy_config_file: str
custom_typeshed_dir: str
mypy_config_file: str | None
custom_typeshed_dir: str | None
check_typeshed: bool
version: str

Expand Down Expand Up @@ -1922,7 +1922,7 @@ def test_stubs(args: _Arguments, use_builtins_fixtures: bool = False) -> int:
options.incremental = False
options.custom_typeshed_dir = args.custom_typeshed_dir
if options.custom_typeshed_dir:
options.abs_custom_typeshed_dir = os.path.abspath(args.custom_typeshed_dir)
options.abs_custom_typeshed_dir = os.path.abspath(options.custom_typeshed_dir)
options.config_file = args.mypy_config_file
options.use_builtins_fixtures = use_builtins_fixtures

Expand Down

0 comments on commit 837f7e0

Please sign in to comment.