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

Unified Diff: third_party/pylint/checkers/python3.py

Issue 876793002: pylint: upgrade to 1.4.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 11 months 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/pylint/checkers/misc.py ('k') | third_party/pylint/checkers/similar.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pylint/checkers/python3.py
diff --git a/third_party/pylint/checkers/python3.py b/third_party/pylint/checkers/python3.py
index 940a1585e2406190a9f08011f312fd8704e8df9e..59c37bf9c91a1284c7c198f5f919065ccdfeea2b 100644
--- a/third_party/pylint/checkers/python3.py
+++ b/third_party/pylint/checkers/python3.py
@@ -252,9 +252,19 @@ class Python3Checker(checkers.BaseChecker):
'map is a generator and must be evaluated. '
'Prefer a for-loop as alternative.',
{'maxversion': (3, 0)}),
+ 'W1632': ('input built-in referenced',
+ 'input-builtin',
+ 'Used when the input built-in is referenced '
+ '(backwards-incompatible semantics in Python 3)',
+ {'maxversion': (3, 0)}),
+ 'W1633': ('round built-in referenced',
+ 'round-builtin',
+ 'Used when the round built-in is referenced '
+ '(backwards-incompatible semantics in Python 3)',
+ {'maxversion': (3, 0)}),
}
- _missing_builtins = frozenset([
+ _bad_builtins = frozenset([
'apply',
'basestring',
'buffer',
@@ -262,9 +272,11 @@ class Python3Checker(checkers.BaseChecker):
'coerce',
'execfile',
'file',
+ 'input', # Not missing, but incompatible semantics
'long',
'raw_input',
'reduce',
+ 'round', # Not missing, but incompatible semantics
'StandardError',
'unicode',
'xrange',
@@ -310,10 +322,10 @@ class Python3Checker(checkers.BaseChecker):
self.add_message('implicit-map-evaluation', node=node)
def visit_name(self, node):
- """Detect when a built-in that is missing in Python 3 is referenced."""
+ """Detect when a "bad" built-in is referenced."""
found_node = node.lookup(node.name)[0]
if getattr(found_node, 'name', None) == '__builtin__':
- if node.name in self._missing_builtins:
+ if node.name in self._bad_builtins:
message = node.name.lower() + '-builtin'
self.add_message(message, node=node)
« no previous file with comments | « third_party/pylint/checkers/misc.py ('k') | third_party/pylint/checkers/similar.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698