diff options
author | David Shea <dshea@redhat.com> | 2014-07-08 08:42:22 -0400 |
---|---|---|
committer | David Shea <dshea@redhat.com> | 2014-07-08 08:42:22 -0400 |
commit | 19e0c67dacf51fea6560bac63903e14914268322 (patch) | |
tree | d10e5510d10f8ae9fe7c9017be01e29c2674297c | |
parent | adb9af53e81c1708404ad0123c0da23f1c267c94 (diff) | |
download | pylint-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.py | 2 |
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 |