From 2c225659f3ae3089a597b9ab148050dd97c48cc9 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 29 Dec 2022 01:23:44 +0000 Subject: [PATCH] stubtest: Improve error message for `__all__`-related errors (#14362) This error is *only* emitted if `__all__` is included in the stub, so the 'if present' clause is unnecessary Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> --- mypy/stubtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index 0e4c36e684c1..bfd8e2b9c81a 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -267,7 +267,7 @@ def _verify_exported_names( object_path + ["__all__"], ( "names exported from the stub do not correspond to the names exported at runtime. " - "This is probably due to things being missing from the stub, or if present, an inaccurate `__all__` in the stub" + "This is probably due to things being missing from the stub or an inaccurate `__all__` in the stub" ), # Pass in MISSING instead of the stub and runtime objects, as the line numbers aren't very # relevant here, and it makes for a prettier error message