summaryrefslogtreecommitdiff
path: root/pylint/checkers/refactoring.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-03-08 18:08:29 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2020-03-08 18:08:29 +0100
commitca87a2c6e181a85cd81a7840e7f1551e511d08db (patch)
treedfddda1bbfde0340e680afd7149d1c1448513501 /pylint/checkers/refactoring.py
parentce58d6e87ac1588311699a30aeb16b60a041fb23 (diff)
downloadpylint-git-ca87a2c6e181a85cd81a7840e7f1551e511d08db.tar.gz
Protect against passing a non-class to _check_exception_inherit_from_stopiteration
Diffstat (limited to 'pylint/checkers/refactoring.py')
-rw-r--r--pylint/checkers/refactoring.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/refactoring.py b/pylint/checkers/refactoring.py
index 4fd988471..013cedcd5 100644
--- a/pylint/checkers/refactoring.py
+++ b/pylint/checkers/refactoring.py
@@ -649,7 +649,7 @@ class RefactoringChecker(checkers.BaseTokenChecker):
if not node.exc:
return
exc = utils.safe_infer(node.exc)
- if exc is None or exc is astroid.Uninferable:
+ if not exc or not isinstance(exc, (astroid.Instance, astroid.ClassDef)):
return
if self._check_exception_inherit_from_stopiteration(exc):
self.add_message("stop-iteration-return", node=node)