summaryrefslogtreecommitdiff
path: root/astroid/inference.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-10-22 20:52:58 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2015-10-22 20:52:58 +0100
commit4920076bfe852de098578034cfe56e8ef0ef96bf (patch)
treea28aa6cc4b52faf35f3126a2d8eab94ebe38ed2b /astroid/inference.py
parent658ecfbb170c040e079ce5619d751fcc3510d4b7 (diff)
downloadastroid-4920076bfe852de098578034cfe56e8ef0ef96bf.tar.gz
Create a call context when inferring unary operands on instances.
Diffstat (limited to 'astroid/inference.py')
-rw-r--r--astroid/inference.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/astroid/inference.py b/astroid/inference.py
index 010607c..b1c81da 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -372,6 +372,9 @@ def _infer_unaryop(self, context=None):
inferred = next(meth.infer(context=context))
if inferred is util.YES or not inferred.callable():
continue
+
+ context = contextmod.copy_context(context)
+ context.callcontext = contextmod.CallContext(args=[operand])
call_results = inferred.infer_call_result(self, context=context)
result = next(call_results, None)
if result is None: