summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Shea <dshea@redhat.com>2014-07-08 08:42:22 -0400
committerDavid Shea <dshea@redhat.com>2014-07-08 08:42:22 -0400
commit19e0c67dacf51fea6560bac63903e14914268322 (patch)
treed10e5510d10f8ae9fe7c9017be01e29c2674297c
parentadb9af53e81c1708404ad0123c0da23f1c267c94 (diff)
downloadpylint-19e0c67dacf51fea6560bac63903e14914268322.tar.gz
Skip sequence index checks on types that do not resolve to an Instance or a
Class. This avoids a crash on types that do not implement getattr, such as UnboundMethod.
-rw-r--r--checkers/typecheck.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/checkers/typecheck.py b/checkers/typecheck.py
index 1869d5f..6a06b81 100644
--- a/checkers/typecheck.py
+++ b/checkers/typecheck.py
@@ -543,7 +543,7 @@ accessed. Python regular expressions are accepted.'}
parent_type = safe_infer(node.parent.value)
- if not parent_type:
+ if not isinstance(parent_type, (astroid.Class, astroid.Instance)):
return
# Determine what method on the parent this index will use