summaryrefslogtreecommitdiff
path: root/astroid/mixins.py
diff options
context:
space:
mode:
authorCeridwen <ceridwenv@gmail.com>2015-08-14 12:02:40 -0400
committerCeridwen <ceridwenv@gmail.com>2015-08-14 12:02:40 -0400
commitc39599ad4f32608cb03e680516678a8fd1ba4dee (patch)
treead7c279bb7a3b34241547ca3d0b079c396533f5f /astroid/mixins.py
parent43f27a00205f5b9b4a341a2c2e3f645dffe14904 (diff)
parentd7294bd79062a4f47db8a761d79e6c1dd166bc72 (diff)
downloadastroid-git-c39599ad4f32608cb03e680516678a8fd1ba4dee.tar.gz
Merge main into default
Diffstat (limited to 'astroid/mixins.py')
-rw-r--r--astroid/mixins.py19
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)