diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-03-05 11:35:05 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-03-05 11:35:55 +0100 |
commit | b7b0f338618aa206bf210d3e5a4f554594d0c44a (patch) | |
tree | e6c5b2f2d460efdabef965aca0a70bb236714982 | |
parent | 2c1e49542a800875904e36e6ac9309c96f7f989c (diff) | |
download | astroid-git-b7b0f338618aa206bf210d3e5a4f554594d0c44a.tar.gz |
Replace handling of AstroidError with MroError
I'm not sure why AstroidError was added in the first place, as this is
the most general exception in astroid.
-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,) |