diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-06 17:06:11 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-06 17:06:11 +0200 |
commit | 4ef9c896f4f8835dc1d49c70844fbc9337b24f93 (patch) | |
tree | 271b200cb901668d8c5ab15c523a2efd97ca258e /astroid/exceptions.py | |
parent | b3d48abbdf673697977f59c5476008a85acb1e27 (diff) | |
download | astroid-git-4ef9c896f4f8835dc1d49c70844fbc9337b24f93.tar.gz |
Add two new exceptions, AstroidImportError and AstroidSyntaxError.
They are subclasses of AstroidBuildingException and are raised when
a module can't be imported from various reasons.
Also do_import_module lets the errors to bubble up without converting
them to InferenceError. This particular conversion happens only
during the inference.
Diffstat (limited to 'astroid/exceptions.py')
-rw-r--r-- | astroid/exceptions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/astroid/exceptions.py b/astroid/exceptions.py index e92abc58..3437a1f9 100644 --- a/astroid/exceptions.py +++ b/astroid/exceptions.py @@ -54,6 +54,14 @@ class AstroidBuildingException(AstroidError): super(AstroidBuildingException, self).__init__(message, **kws) +class AstroidImportError(AstroidBuildingException): + """Exception class used when a module can't be imported by astroid.""" + + +class AstroidSyntaxError(AstroidBuildingException): + """Exception class used when a module can't be parsed.""" + + class NoDefault(AstroidError): """raised by function's `default_value` method when an argument has no default value @@ -96,9 +104,11 @@ class MroError(ResolveError): for m in self.mros) return self.message.format(mros=mro_names, cls=self.cls) + 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.""" |