Skip to content

Commit

Permalink
Correct pre-commit's pylint warnings (#2407)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
crazybolillo and Pierre-Sassoulas committed Apr 4, 2024
1 parent de942f3 commit 7a3b482
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions astroid/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 7a3b482

Please sign in to comment.