Skip to content

Commit

Permalink
Fix --install-types masking failure details (#17485)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wyattscarpenter and hauntsaninja authored Dec 30, 2024
1 parent c821503 commit 7b61945
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,9 @@ def read_types_packages_to_install(cache_dir: str, after_run: bool) -> list[str]
+ "(and no cache from previous mypy run)\n"
)
else:
sys.stderr.write("error: --install-types failed (no mypy cache directory)\n")
sys.exit(2)
sys.stderr.write(
"error: --install-types failed (an error blocked analysis of which types to install)\n"
)
fnam = build.missing_stubs_file(cache_dir)
if not os.path.isfile(fnam):
# No missing stubs.
Expand Down

0 comments on commit 7b61945

Please sign in to comment.