diff options
-rw-r--r-- | astroid/brain/brain_builtin_inference.py | 6 | ||||
-rw-r--r-- | astroid/helpers.py | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/astroid/brain/brain_builtin_inference.py b/astroid/brain/brain_builtin_inference.py index 9d1f0b69..aba714f3 100644 --- a/astroid/brain/brain_builtin_inference.py +++ b/astroid/brain/brain_builtin_inference.py @@ -13,7 +13,7 @@ from textwrap import dedent import six from astroid import (MANAGER, UseInferenceDefault, AttributeInferenceError, inference_tip, InferenceError, NameInferenceError, - AstroidTypeError, AstroidError) + AstroidTypeError, MroError) from astroid import arguments from astroid.builder import AstroidBuilder from astroid import helpers @@ -548,8 +548,8 @@ def infer_isinstance(callnode, context=None): obj_node, class_container, context) except AstroidTypeError as exc: raise UseInferenceDefault("TypeError: " + str(exc)) - except AstroidError: - raise UseInferenceDefault + except MroError as exc: + raise UseInferenceDefault from exc if isinstance_bool is util.Uninferable: raise UseInferenceDefault return nodes.Const(isinstance_bool) diff --git a/astroid/helpers.py b/astroid/helpers.py index 2e633a07..d3522442 100644 --- a/astroid/helpers.py +++ b/astroid/helpers.py @@ -91,8 +91,6 @@ def object_isinstance(node, class_or_seq, context=None): :rtype: bool :raises AstroidTypeError: if the given ``classes_or_seq`` are not types - :raises AstroidError: if the type of the given node cannot be inferred - or its type's mro doesn't work """ if not isinstance(class_or_seq, (tuple, list)): class_seq = (class_or_seq,) |