Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: third_party/logilab/astroid/mixins.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/logilab/astroid/manager.py ('k') | third_party/logilab/astroid/modutils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « third_party/logilab/astroid/manager.py ('k') | third_party/logilab/astroid/modutils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698