diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-13 09:47:49 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-13 09:47:49 +0200 |
commit | 265c5c41f089cd3a738910054b08cfc3709c131c (patch) | |
tree | 1b98fbb3458f384195b73aa7cbe7733084cda18a /astroid/inference.py | |
parent | 2695f52edce4d05c501f59efe5955a97c7a0df66 (diff) | |
download | astroid-git-265c5c41f089cd3a738910054b08cfc3709c131c.tar.gz |
Make sure that context_lookup is always defined
Diffstat (limited to 'astroid/inference.py')
-rw-r--r-- | astroid/inference.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/astroid/inference.py b/astroid/inference.py index 76401f86..33730a39 100644 --- a/astroid/inference.py +++ b/astroid/inference.py @@ -186,6 +186,7 @@ def infer_call(self, context=None): callcontext.callcontext = contextmod.CallContext(args=self.args, keywords=self.keywords) callcontext.boundnode = None + context_lookup = None if context is not None: context_lookup = _populate_context_lookup(self, context.clone()) for callee in self.func.infer(context): @@ -194,7 +195,11 @@ def infer_call(self, context=None): continue try: if hasattr(callee, 'infer_call_result'): - yield from callee.infer_call_result(self, callcontext, context_lookup) + yield from callee.infer_call_result( + caller=self, + context=callcontext, + context_lookup=context_lookup, + ) except exceptions.InferenceError: ## XXX log error ? continue |