summaryrefslogtreecommitdiff
path: root/astroid/exceptions.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-06-03 15:44:31 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2016-06-03 16:00:53 +0100
commit3e27213914271309a4716662b09fda91fca9efa1 (patch)
tree716d375804c63ea58c65f2e27a0d6350e537f6b9 /astroid/exceptions.py
parent119c8c6a70a166283b2f0cd5cfa18b45d8592ab9 (diff)
downloadastroid-git-3e27213914271309a4716662b09fda91fca9efa1.tar.gz
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.
Diffstat (limited to 'astroid/exceptions.py')
-rw-r--r--astroid/exceptions.py4
1 files changed, 4 insertions, 0 deletions
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