summaryrefslogtreecommitdiff
path: root/astroid/node_classes.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-06-16 09:12:43 +0200
committerGitHub <noreply@github.com>2020-06-16 09:12:43 +0200
commit5e9519dfb1364a69abeca44f80480237526d67e3 (patch)
tree0ed91652f9f41c46f94d9e4f7f7e520bd60f65c3 /astroid/node_classes.py
parent03e2986682b429d1ffb1f017e34537ab4c8e2ac5 (diff)
downloadastroid-git-2.4.tar.gz
Fix a crash caused by a lookup of a monkey-patched method (#803)2.4
Close PyCQA/pylint#3686
Diffstat (limited to 'astroid/node_classes.py')
-rw-r--r--astroid/node_classes.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/astroid/node_classes.py b/astroid/node_classes.py
index 621dc5f2..dfe85b04 100644
--- a/astroid/node_classes.py
+++ b/astroid/node_classes.py
@@ -1149,10 +1149,9 @@ class LookupMixIn:
_stmts = []
_stmt_parents = []
statements = self._get_filtered_node_statements(stmts)
-
for node, stmt in statements:
# line filtering is on and we have reached our location, break
- if stmt.fromlineno > mylineno > 0:
+ if stmt.fromlineno and stmt.fromlineno > mylineno > 0:
break
# Ignore decorators with the same name as the
# decorated function