Deal with inheritance properly when dealing with function executions

This commit is contained in:
Dave Halter
2019-09-03 13:29:25 +02:00
parent fe5523268e
commit 0a420339e8
3 changed files with 21 additions and 22 deletions
+3 -3
View File
@@ -178,7 +178,7 @@ def _get_potential_nodes(module_value, func_string_name):
def _check_name_for_execution(inference_state, context, compare_node, name, trailer):
from jedi.inference.value.function import FunctionExecutionContext
from jedi.inference.value.function import BaseFunctionExecutionContext
def create_func_excs(value):
arglist = trailer.children[1]
@@ -203,8 +203,8 @@ def _check_name_for_execution(inference_state, context, compare_node, name, trai
for func_execution in create_func_excs(value):
# TODO private access
yield func_execution._arguments
elif isinstance(value.parent_context, FunctionExecutionContext) and \
compare_node.type == 'funcdef':
elif isinstance(value.parent_context, BaseFunctionExecutionContext) \
and compare_node.type == 'funcdef':
# Here we're trying to find decorators by checking the first
# parameter. It's not very generic though. Should find a better
# solution that also applies to nested decorators.