diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-03 09:21:04 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-03 09:21:04 +0300 |
commit | b246a25c85c1787296811cfbb811fa3528d7966a (patch) | |
tree | 275110424e73e5bf14af70917d7ffe1791d66bbe /astroid/exceptions.py | |
parent | 3c27106a48076d411b7e3e943c4065503f4d02cc (diff) | |
download | astroid-b246a25c85c1787296811cfbb811fa3528d7966a.tar.gz |
Add two new exceptions for handling MRO error cases.
DuplicateBasesError is emitted when duplicate bases are found in a class,
InconsistentMroError is raised when the method resolution is determined
to be inconsistent. They share a common class, MroError, which
is a subclass of ResolveError, meaning that this change is backwards compatible.
Diffstat (limited to 'astroid/exceptions.py')
-rw-r--r-- | astroid/exceptions.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/astroid/exceptions.py b/astroid/exceptions.py index 3889e2e..d1094ce 100644 --- a/astroid/exceptions.py +++ b/astroid/exceptions.py @@ -30,6 +30,18 @@ class AstroidBuildingException(AstroidError): class ResolveError(AstroidError): """base class of astroid resolution/inference error""" +class MroError(ResolveError): + """Error raised when there is a problem with method resolution of a class.""" + + +class DuplicateBasesError(MroError): + """Error raised when there are duplicate bases in the same class bases.""" + + +class InconsistentMroError(MroError): + """Error raised when a class's MRO is inconsistent.""" + + class NotFoundError(ResolveError): """raised when we are unable to resolve a name""" |