From 3e27213914271309a4716662b09fda91fca9efa1 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Fri, 3 Jun 2016 15:44:31 +0100 Subject: Now is_subtype / is_supertype raises an internal exception when a type hierarchy can't be determined It used to return Uninferable, but no call site was actually taking care of this potential return. It is better though to simply raise an exception and to let the call sites to handle them in which way they want to. --- astroid/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'astroid/exceptions.py') diff --git a/astroid/exceptions.py b/astroid/exceptions.py index 0a4d5d87..7098bd85 100644 --- a/astroid/exceptions.py +++ b/astroid/exceptions.py @@ -181,6 +181,10 @@ class UseInferenceDefault(Exception): """ +class _NonDeducibleTypeHierarchy(Exception): + """Raised when is_subtype / is_supertype can't deduce the relation between two types.""" + + # Backwards-compatibility aliases OperationError = util.BadOperationMessage UnaryOperationError = util.BadUnaryOperationMessage -- cgit v1.2.1