summaryrefslogtreecommitdiff
path: root/pylint/checkers/base.py
diff options
context:
space:
mode:
authorFantix King <fantix@uchicago.edu>2019-02-20 14:42:13 -0600
committerClaudiu Popa <pcmanticore@gmail.com>2019-02-22 18:09:53 +0100
commit15e405f20c9432f50c677a4026adc76124716861 (patch)
tree57b996ff4d6c24c896e261eb610437e7bd42bd1a /pylint/checkers/base.py
parent8c1116851fadf3f46f9ad2ce7fcbfb5acdf36da3 (diff)
downloadpylint-git-15e405f20c9432f50c677a4026adc76124716861.tar.gz
Fix bug of W0120
When break is deep in the else of an inner loop, W0120 was raised.
Diffstat (limited to 'pylint/checkers/base.py')
-rw-r--r--pylint/checkers/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py
index 05de23ef8..043700f02 100644
--- a/pylint/checkers/base.py
+++ b/pylint/checkers/base.py
@@ -246,6 +246,7 @@ def _get_break_loop_node(break_node):
while not isinstance(parent, loop_nodes) or break_node in getattr(
parent, "orelse", []
):
+ break_node = parent
parent = parent.parent
if parent is None:
break