Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
"typing_extensions",
"mypy_extensions",
"_importlib_modulespec",
Comment thread
ilevkivskyi marked this conversation as resolved.
Outdated
"_typeshed",
"_collections_abc",
"collections",
"collections.abc",
"sys",
"abc",
}
Expand Down Expand Up @@ -2637,7 +2641,7 @@ def find_module_and_diagnose(
result.endswith(".pyi") # Stubs are always normal
and not options.follow_imports_for_stubs # except when they aren't
)
or id in mypy.semanal_main.core_modules # core is always normal
or id in CORE_BUILTIN_MODULES # core is always normal
):
follow_imports = "normal"
if skip_diagnose:
Expand Down
10 changes: 10 additions & 0 deletions test-data/unit/check-flags.test
Original file line number Diff line number Diff line change
Expand Up @@ -2174,3 +2174,13 @@ def f(x: bytes, y: bytearray, z: memoryview) -> None:
x in y
x in z
[builtins fixtures/primitives.pyi]

[case testNoCrashFollowImportsForStubs]
# flags: --config-file tmp/mypy.ini
{**{"x": "y"}}

[file mypy.ini]
\[mypy]
follow_imports = skip
follow_imports_for_stubs = true
[builtins fixtures/dict.pyi]