From 533834bf931ddfff8d2b43f72e284668b10be86d Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 5 Jul 2024 04:08:32 -0500 Subject: [PATCH 1/3] Fix https://github.com/python/mypy/issues/10768 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. --- mypy/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index 05044335ecee..5b15eb4b7936 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1549,7 +1549,6 @@ def read_types_packages_to_install(cache_dir: str, after_run: bool) -> list[str] ) else: sys.stderr.write("error: --install-types failed (no mypy cache directory)\n") - sys.exit(2) fnam = build.missing_stubs_file(cache_dir) if not os.path.isfile(fnam): # No missing stubs. From 871e0d03bea2f9017d1e9dca139731e50a93b796 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:10:11 -0800 Subject: [PATCH 2/3] Update mypy/main.py --- mypy/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index 5b15eb4b7936..929014118b1f 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1548,7 +1548,7 @@ 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.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. From c9df1010a2f36eb50c0a9241ed8c6e93b6c97ee3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:10:37 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mypy/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mypy/main.py b/mypy/main.py index 929014118b1f..2e975c4cfcea 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -1548,7 +1548,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 (an error blocked analysis of which types to install)\n") + 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.