diff options
Diffstat (limited to 'astroid/manager.py')
-rw-r--r-- | astroid/manager.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/astroid/manager.py b/astroid/manager.py index f2aa9d2..c332d0f 100644 --- a/astroid/manager.py +++ b/astroid/manager.py @@ -89,7 +89,7 @@ class AstroidManager(object): return AstroidBuilder(self).file_build(filepath, modname) elif fallback and modname: return self.ast_from_module_name(modname) - raise exceptions.AstroidBuildingException( + raise exceptions.AstroidBuildingError( 'Unable to build an AST for {path}.', path=filepath) def _build_stub_module(self, modname): @@ -140,11 +140,11 @@ class AstroidManager(object): "Can't find a file for module {modname}.", modname=modname) return self.ast_from_file(filepath, modname, fallback=False) - except exceptions.AstroidBuildingException as e: + except exceptions.AstroidBuildingError as e: for hook in self._failed_import_hooks: try: return hook(modname) - except exceptions.AstroidBuildingException: + except exceptions.AstroidBuildingError: pass raise e finally: @@ -187,8 +187,8 @@ class AstroidManager(object): modname=modname, error=ex) traceback = sys.exc_info()[2] self._mod_file_cache[(modname, contextfile)] = value - if isinstance(value, exceptions.AstroidBuildingException): - six.reraise(exceptions.AstroidBuildingException, + if isinstance(value, exceptions.AstroidBuildingError): + six.reraise(exceptions.AstroidBuildingError, value, traceback) return value @@ -213,7 +213,7 @@ class AstroidManager(object): try: modname = klass.__module__ except AttributeError: - util.reraise(exceptions.AstroidBuildingException( + util.reraise(exceptions.AstroidBuildingError( 'Unable to get module for class {class_name}.', cls=klass, class_repr=safe_repr(klass), modname=modname)) modastroid = self.ast_from_module_name(modname) @@ -228,7 +228,7 @@ class AstroidManager(object): try: modname = klass.__module__ except AttributeError: - util.reraise(exceptions.AstroidBuildingException( + util.reraise(exceptions.AstroidBuildingError( 'Unable to get module for {class_repr}.', cls=klass, class_repr=safe_repr(klass))) except Exception as ex: # pylint: disable=broad-except @@ -238,7 +238,7 @@ class AstroidManager(object): try: name = klass.__name__ except AttributeError: - util.reraise(exceptions.AstroidBuildingException( + util.reraise(exceptions.AstroidBuildingError( 'Unable to get name for {class_repr}:\n', cls=klass, class_repr=safe_repr(klass))) except Exception as ex: # pylint: disable=broad-except @@ -260,7 +260,7 @@ class AstroidManager(object): `hook` must be a function that accepts a single argument `modname` which contains the name of the module or package that could not be imported. If `hook` can resolve the import, must return a node of type `astroid.Module`, - otherwise, it must raise `AstroidBuildingException`. + otherwise, it must raise `AstroidBuildingError`. """ self._failed_import_hooks.append(hook) |