summaryrefslogtreecommitdiff
path: root/pylint/checkers/refactoring.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-07-15 11:27:57 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-07-15 11:27:57 +0200
commit6f087b25b3b751ddb2c1cbd03f4b406fd82da78a (patch)
tree31ffd6db4cf3e459b81920edf4294ebcd603b242 /pylint/checkers/refactoring.py
parente78be1690e3949fca26312a0a2e5d8f8c0ffae0b (diff)
downloadpylint-git-6f087b25b3b751ddb2c1cbd03f4b406fd82da78a.tar.gz
Validate that the next() builtin is called when looking for stop-iteration-return, and ignore attributes named the same
Diffstat (limited to 'pylint/checkers/refactoring.py')
-rw-r--r--pylint/checkers/refactoring.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pylint/checkers/refactoring.py b/pylint/checkers/refactoring.py
index e4883bccd..30f50cdd9 100644
--- a/pylint/checkers/refactoring.py
+++ b/pylint/checkers/refactoring.py
@@ -479,6 +479,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):
return inferred.qname() in KNOWN_INFINITE_ITERATORS
return False
+ if isinstance(node.func, astroid.Attribute):
+ # A next() method, which is now what we want.
+ return
+
inferred = utils.safe_infer(node.func)
if getattr(inferred, 'name', '') == 'next':
frame = node.frame()