aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio <antonio@zoftko.com>2024-04-04 00:43:40 -0600
committerGitHub <noreply@github.com>2024-04-04 08:43:40 +0200
commit7a3b482b9673243d2ccc895672eb1e452f5daa82 (patch)
tree875a1f978dfaadbc5fec1e6936c1024004e3444b
parentde942f3076ff3d1263b1e598c89a6bb31e4a27ea (diff)
downloadastroid-upstream-main.tar.gz
Correct pre-commit's pylint warnings (#2407)upstream-main
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 <pierre.sassoulas@gmail.com>
-rw-r--r--astroid/manager.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/astroid/manager.py b/astroid/manager.py
index 4ef3e828..a7a51f19 100644
--- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -309,7 +309,6 @@ class AstroidManager:
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 @@ class AstroidManager:
# 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()