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

Unified Diff: third_party/pylint/checkers/typecheck.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/stdlib.py ('k') | third_party/pylint/checkers/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pylint/checkers/typecheck.py
diff --git a/third_party/pylint/checkers/typecheck.py b/third_party/pylint/checkers/typecheck.py
index 10b9f8669fb9353ab9e4766e5174a6ef5a257078..9f074ae05f6cfd662e8f246ce7b2274cb2359adf 100644
--- a/third_party/pylint/checkers/typecheck.py
+++ b/third_party/pylint/checkers/typecheck.py
@@ -344,11 +344,16 @@ accessed. Python regular expressions are accepted.'}
if not isinstance(attr, astroid.Function):
continue
- # Decorated, see if it is decorated with a property
+ # Decorated, see if it is decorated with a property.
+ # Also, check the returns and see if they are callable.
if decorated_with_property(attr):
- self.add_message('not-callable', node=node,
- args=node.func.as_string())
- break
+ if all(return_node.callable()
+ for return_node in attr.infer_call_result(node)):
+ continue
+ else:
+ self.add_message('not-callable', node=node,
+ args=node.func.as_string())
+ break
@check_messages(*(list(MSGS.keys())))
def visit_callfunc(self, node):
« no previous file with comments | « third_party/pylint/checkers/stdlib.py ('k') | third_party/pylint/checkers/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698