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

Unified Diff: third_party/logilab/astroid/protocols.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/node_classes.py ('k') | third_party/logilab/astroid/raw_building.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/astroid/protocols.py
diff --git a/third_party/logilab/astroid/protocols.py b/third_party/logilab/astroid/protocols.py
index e7703a06f6aefcd5a52e5c260aa978a30d14b8bf..4dd515fd00f6a58438ed2c0ca133c2575dac5c9c 100644
--- a/third_party/logilab/astroid/protocols.py
+++ b/third_party/logilab/astroid/protocols.py
@@ -23,7 +23,7 @@ __doctype__ = "restructuredtext en"
from astroid.exceptions import InferenceError, NoDefault, NotFoundError
from astroid.node_classes import unpack_infer
-from astroid.bases import copy_context, \
+from astroid.bases import InferenceContext, \
raise_if_nothing_infered, yes_if_nothing_infered, Instance, YES
from astroid.nodes import const_factory
from astroid import nodes
@@ -91,7 +91,7 @@ BIN_OP_IMPL = {'+': lambda a, b: a + b,
'<<': lambda a, b: a << b,
'>>': lambda a, b: a >> b,
}
-for key, impl in BIN_OP_IMPL.items():
+for key, impl in list(BIN_OP_IMPL.items()):
BIN_OP_IMPL[key+'='] = impl
def const_infer_binary_op(self, operator, other, context):
@@ -282,7 +282,8 @@ def _arguments_infer_argname(self, name, context):
# if there is a default value, yield it. And then yield YES to reflect
# we can't guess given argument value
try:
- context = copy_context(context)
+ if context is None:
+ context = InferenceContext()
for infered in self.default_value(name).infer(context):
yield infered
yield YES
@@ -294,13 +295,8 @@ def arguments_assigned_stmts(self, node, context, asspath=None):
if context.callcontext:
# reset call context/name
callcontext = context.callcontext
- context = copy_context(context)
- context.callcontext = None
- for infered in callcontext.infer_argument(self.parent, node.name, context):
- yield infered
- return
- for infered in _arguments_infer_argname(self, node.name, context):
- yield infered
+ return callcontext.infer_argument(self.parent, node.name, context)
+ return _arguments_infer_argname(self, node.name, context)
nodes.Arguments.assigned_stmts = arguments_assigned_stmts
« no previous file with comments | « third_party/logilab/astroid/node_classes.py ('k') | third_party/logilab/astroid/raw_building.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698