Skip to content

Commit 7e61402

Browse files
committed
Demo special case for builtins
1 parent c27e832 commit 7e61402

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# TODO: More consistent terminology, e.g. path/fnam, module/id, state/file
1212

1313
from __future__ import annotations
14-
14+
import pathlib
1515
import collections
1616
import contextlib
1717
import errno
@@ -3078,7 +3078,7 @@ def load_graph(
30783078
path=bs.path,
30793079
source=bs.text,
30803080
manager=manager,
3081-
root_source=not bs.followed,
3081+
root_source=not (bs.followed or bs.module == "builtins"),
30823082
)
30833083
except ModuleNotFound:
30843084
continue
@@ -3535,6 +3535,8 @@ def record_missing_stub_packages(cache_dir: str, missing_stub_packages: set[str]
35353535
def is_silent_import_module(manager: BuildManager, path: str) -> bool:
35363536
if manager.options.no_silence_site_packages:
35373537
return False
3538+
if pathlib.Path(path).name == "builtins.pyi":
3539+
return True
35383540
# Silence errors in site-package dirs and typeshed
35393541
return any(
35403542
is_sub_path(path, dir)

0 commit comments

Comments
 (0)