diff options
Diffstat (limited to 'astroid/mixins.py')
-rw-r--r-- | astroid/mixins.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/astroid/mixins.py b/astroid/mixins.py index ec7b7b69..87834f10 100644 --- a/astroid/mixins.py +++ b/astroid/mixins.py @@ -20,16 +20,14 @@ import warnings -from logilab.common.decorators import cachedproperty - -from astroid.exceptions import (AstroidBuildingException, InferenceError, - NotFoundError) +from astroid import decorators +from astroid import exceptions class BlockRangeMixIn(object): """override block range """ - @cachedproperty + @decorators.cachedproperty def blockstart_tolineno(self): return self.lineno @@ -129,12 +127,12 @@ class ImportFromMixin(FilterStmtsMixin): try: return mymodule.import_module(modname, level=level, relative_only=level and level >= 1) - except AstroidBuildingException as ex: + except exceptions.AstroidBuildingException as ex: if isinstance(ex.args[0], SyntaxError): - raise InferenceError(str(ex)) - raise InferenceError(modname) + raise exceptions.InferenceError(str(ex)) + raise exceptions.InferenceError(modname) except SyntaxError as ex: - raise InferenceError(str(ex)) + raise exceptions.InferenceError(str(ex)) def real_name(self, asname): """get name from 'as' name""" @@ -146,5 +144,4 @@ class ImportFromMixin(FilterStmtsMixin): _asname = name if asname == _asname: return name - raise NotFoundError(asname) - + raise exceptions.NotFoundError(asname) |