Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions astroid/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from astroid.modutils import (
NoSourceFile,
_cache_normalize_path_,
_has_init,
file_info_from_modpath,
get_source_file,
is_module_name_part_of_extension_package_whitelist,
Expand Down Expand Up @@ -457,6 +458,7 @@ def clear_cache(self) -> None:
for lru_cache in (
LookupMixIn.lookup,
_cache_normalize_path_,
_has_init,
util.is_namespace,
ObjectModel.attributes,
ClassDef._metaclass_lookup_attribute,
Expand Down
1 change: 1 addition & 0 deletions astroid/modutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ def _is_python_file(filename: str) -> bool:
return filename.endswith((".py", ".pyi", ".so", ".pyd", ".pyw"))


@lru_cache(maxsize=1024)
def _has_init(directory: str) -> str | None:
"""If the given directory has a valid __init__ file, return its path,
else return None.
Expand Down