summaryrefslogtreecommitdiff
path: root/astroid/objects.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-05-01 17:59:20 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2020-05-01 17:59:38 +0200
commit6aae91559d29acd3042e1fd26e0d111261521010 (patch)
treedb1aabf4e433dd81a196436315cc7e84d25de55c /astroid/objects.py
parente40ac59e470d7166369732f84b8ae7ce9164b0a3 (diff)
downloadastroid-git-6aae91559d29acd3042e1fd26e0d111261521010.tar.gz
Protect against ``infer_call_result`` failing with `InferenceError` in `Super.getattr()` (#782)
``infer_call_result`` can raise InferenceError but we were not handling that when retrieving objects from the Super instance. Close PyCQA/pylint#3529
Diffstat (limited to 'astroid/objects.py')
-rw-r--r--astroid/objects.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/astroid/objects.py b/astroid/objects.py
index 68d74aa2..fb782e6d 100644
--- a/astroid/objects.py
+++ b/astroid/objects.py
@@ -187,7 +187,12 @@ class Super(node_classes.NodeNG):
yield inferred
elif isinstance(inferred, Property):
function = inferred.function
- yield from function.infer_call_result(caller=self, context=context)
+ try:
+ yield from function.infer_call_result(
+ caller=self, context=context
+ )
+ except exceptions.InferenceError:
+ yield util.Uninferable
elif bases._is_property(inferred):
# TODO: support other descriptors as well.
try: