Skip to content
Snippets Groups Projects
Commit b7b0f338 authored by Claudiu Popa's avatar Claudiu Popa
Browse files

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.
parent 2c1e4954
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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,)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment