Skip to content

Commit 7a3b482

Browse files
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 <[email protected]>
1 parent de942f3 commit 7a3b482

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

astroid/manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ def file_from_module_name(
309309
modname.split("."), context_file=contextfile
310310
)
311311
except ImportError as e:
312-
# pylint: disable-next=redefined-variable-type
313312
value = AstroidImportError(
314313
"Failed to import module {modname} with error:\n{error}.",
315314
modname=modname,
@@ -406,8 +405,7 @@ def infer_ast_from_something(
406405
# take care, on living object __module__ is regularly wrong :(
407406
modastroid = self.ast_from_module_name(modname)
408407
if klass is obj:
409-
for inferred in modastroid.igetattr(name, context):
410-
yield inferred
408+
yield from modastroid.igetattr(name, context)
411409
else:
412410
for inferred in modastroid.igetattr(name, context):
413411
yield inferred.instantiate_class()

0 commit comments

Comments
 (0)