From 7a3b482b9673243d2ccc895672eb1e452f5daa82 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 4 Apr 2024 00:43:40 -0600 Subject: [PATCH] Correct pre-commit's pylint warnings (#2407) The introduction of use-yield-from generated a new warning on the source code. Some messages no longer needed to be disabled as well. These warnings have been corrected to prevent pre-commit from failing. --------- Co-authored-by: Pierre Sassoulas --- astroid/manager.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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()