Skip to content
Merged
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
7 changes: 5 additions & 2 deletions astroid/nodes/_base_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ def do_import_module(self, modname: str | None = None) -> nodes.Module:
# If the module ImportNode is importing is a module with the same name
# as the file that contains the ImportNode we don't want to use the cache
# to make sure we use the import system to get the correct module.
# pylint: disable-next=no-member # pylint doesn't recognize type of mymodule
if mymodule.relative_to_absolute_name(modname, level) == mymodule.name:
if (
modname
# pylint: disable-next=no-member # pylint doesn't recognize type of mymodule
and mymodule.relative_to_absolute_name(modname, level) == mymodule.name
):
use_cache = False
else:
use_cache = True
Expand Down