From c77a5745e42d6c6d5334f83e2af3a3f6a1b618b5 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Fri, 1 May 2020 17:59:20 +0200 Subject: 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 --- astroid/objects.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'astroid') 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: -- cgit v1.2.1