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

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

Issue 776883002: pylint: upgrade to 1.4.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
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
===================================================================
--- third_party/logilab/astroid/mixins.py (revision 293207)
+++ third_party/logilab/astroid/mixins.py (working copy)
@@ -18,6 +18,8 @@
"""This module contains some mixins for the different nodes.
"""
+from logilab.common.decorators import cachedproperty
+
from astroid.exceptions import (AstroidBuildingException, InferenceError,
NotFoundError)
@@ -24,11 +26,11 @@
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
statements
@@ -105,7 +107,7 @@
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