diff --git a/astroid/manager.py b/astroid/manager.py index 4ef3e8288f..a7a51f19c5 100644 --- a/astroid/manager.py +++ b/astroid/manager.py @@ -309,7 +309,6 @@ def file_from_module_name( modname.split("."), context_file=contextfile ) except ImportError as e: - # pylint: disable-next=redefined-variable-type value = AstroidImportError( "Failed to import module {modname} with error:\n{error}.", modname=modname, @@ -406,8 +405,7 @@ def infer_ast_from_something( # take care, on living object __module__ is regularly wrong :( modastroid = self.ast_from_module_name(modname) if klass is obj: - for inferred in modastroid.igetattr(name, context): - yield inferred + yield from modastroid.igetattr(name, context) else: for inferred in modastroid.igetattr(name, context): yield inferred.instantiate_class()