| Index: third_party/logilab/astroid/mixins.py
|
| diff --git a/third_party/logilab/astroid/mixins.py b/third_party/logilab/astroid/mixins.py
|
| index f903724559eb4458b152beb49599b3b1615731fc..dbf1673a321465cca9e3bae2322c39f2a5646747 100644
|
| --- a/third_party/logilab/astroid/mixins.py
|
| +++ b/third_party/logilab/astroid/mixins.py
|
| @@ -18,16 +18,18 @@
|
| """This module contains some mixins for the different nodes.
|
| """
|
|
|
| +from logilab.common.decorators import cachedproperty
|
| +
|
| from astroid.exceptions import (AstroidBuildingException, InferenceError,
|
| NotFoundError)
|
|
|
|
|
| class BlockRangeMixIn(object):
|
| """override block range """
|
| - def set_line_info(self, lastchild):
|
| - self.fromlineno = self.lineno
|
| - self.tolineno = lastchild.tolineno
|
| - self.blockstart_tolineno = self._blockstart_toline()
|
| +
|
| + @cachedproperty
|
| + def blockstart_tolineno(self):
|
| + return self.lineno
|
|
|
| def _elsed_block_range(self, lineno, orelse, last=None):
|
| """handle block line numbers range for try/finally, for, if and while
|
| @@ -105,7 +107,7 @@ class FromImportMixIn(FilterStmtsMixin):
|
| return mymodule.import_module(modname, level=level)
|
| except AstroidBuildingException:
|
| raise InferenceError(modname)
|
| - except SyntaxError, ex:
|
| + except SyntaxError as ex:
|
| raise InferenceError(str(ex))
|
|
|
| def real_name(self, asname):
|
|
|