diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-06-03 15:44:31 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-06-03 16:00:53 +0100 |
commit | 3e27213914271309a4716662b09fda91fca9efa1 (patch) | |
tree | 716d375804c63ea58c65f2e27a0d6350e537f6b9 /astroid/exceptions.py | |
parent | 119c8c6a70a166283b2f0cd5cfa18b45d8592ab9 (diff) | |
download | astroid-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.py | 4 |
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 |