Skip to content

Commit 7b61945

Browse files
Fix --install-types masking failure details (#17485)
It seems that: if the mypy cache dir wasn't created, this code would do an exit, preventing the actual errors from being printed. So I've removed the exit. More information is available at the issue I claim this fixes. Fixes #10768 --------- Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
1 parent c821503 commit 7b61945

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,9 @@ def read_types_packages_to_install(cache_dir: str, after_run: bool) -> list[str]
15751575
+ "(and no cache from previous mypy run)\n"
15761576
)
15771577
else:
1578-
sys.stderr.write("error: --install-types failed (no mypy cache directory)\n")
1579-
sys.exit(2)
1578+
sys.stderr.write(
1579+
"error: --install-types failed (an error blocked analysis of which types to install)\n"
1580+
)
15801581
fnam = build.missing_stubs_file(cache_dir)
15811582
if not os.path.isfile(fnam):
15821583
# No missing stubs.

0 commit comments

Comments
 (0)