Skip to content

Commit ad8d88e

Browse files
Avoid some inference in no-name-from-module (#9428)
1 parent eef4794 commit ad8d88e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pylint/checkers/variables.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,9 +3080,11 @@ def _check_module_attrs(
30803080
module = None
30813081
break
30823082
try:
3083-
module = next(module.getattr(name)[0].infer())
3083+
module = module.getattr(name)[0]
30843084
if not isinstance(module, nodes.Module):
3085-
return None
3085+
module = next(module.infer())
3086+
if not isinstance(module, nodes.Module):
3087+
return None
30863088
except astroid.NotFoundError:
30873089
# Unable to import `name` from `module`. Since `name` may itself be a
30883090
# module, we first check if it matches the ignored modules.

0 commit comments

Comments
 (0)