summaryrefslogtreecommitdiff
path: root/astroid/inference.py
diff options
context:
space:
mode:
authorBryce Guinta <bryce.paul.guinta@gmail.com>2018-03-28 20:51:03 -0600
committerBryce Guinta <bryce.paul.guinta@gmail.com>2018-03-30 21:45:07 -0700
commit6a3b33afb1be93e4d1a2b989ce31af24ece1137f (patch)
tree4e4f7a4ff421e3d778307f48fb94fdd033ed7be9 /astroid/inference.py
parentfda4d06680e67284c89fea56b3b22dee0980d992 (diff)
downloadastroid-git-6a3b33afb1be93e4d1a2b989ce31af24ece1137f.tar.gz
Set context boundnode for binary operation to correct inference
Diffstat (limited to 'astroid/inference.py')
-rw-r--r--astroid/inference.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/astroid/inference.py b/astroid/inference.py
index 0a55b6e8..a0a933eb 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -520,6 +520,8 @@ def _is_not_implemented(const):
def _invoke_binop_inference(instance, opnode, op, other, context, method_name):
"""Invoke binary operation inference on the given instance."""
methods = dunder_lookup.lookup(instance, method_name)
+ if context is not None:
+ context.boundnode = instance
method = methods[0]
inferred = next(method.infer(context=context))
return instance.infer_binary_op(opnode, op, other, context, inferred)