File tree Expand file tree Collapse file tree
astroid/interpreter/_import Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ Release date: TBA
7171
7272 Closes #2923
7373
74+ * Fix ``is_namespace()`` crash when search locations contain ``pathlib.Path`` objects.
75+
76+ Closes #2942
77+
7478What's New in astroid 4.0.3?
7579============================
7680Release date: 2026-01-03
Original file line number Diff line number Diff line change @@ -95,7 +95,10 @@ def is_namespace(modname: str) -> bool:
9595 # But immediately return False if we can detect we are in stdlib
9696 # or external lib (e.g site-packages)
9797 if any (
98- any (location .startswith (lib_dir ) for lib_dir in STD_AND_EXT_LIB_DIRS )
98+ any (
99+ str (location ).startswith (lib_dir )
100+ for lib_dir in STD_AND_EXT_LIB_DIRS
101+ )
99102 for location in found_spec .submodule_search_locations
100103 ):
101104 return False
You can’t perform that action at this time.
0 commit comments