Skip to content

Commit

Permalink
check isinstance
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Nov 2, 2022
1 parent 499eedd commit abfd9ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pylint/checkers/refactoring/refactoring_checker.py
Expand Up @@ -1131,11 +1131,15 @@ def _looks_like_infinite_iterator(param: nodes.NodeNG) -> bool:
return False

if isinstance(node.func, nodes.Attribute):
# Only want the builtin next method.
# A next() method, which is now what we want.
return

inferred = utils.safe_infer(node.func)
if inferred.qname() == "builtins.next":

if (
isinstance(inferred, nodes.FunctionDef)
and inferred.qname() == "builtins.next"
):
frame = node.frame(future=True)
# The next builtin can only have up to two
# positional arguments and no keyword arguments
Expand Down

0 comments on commit abfd9ee

Please sign in to comment.