1
0
forked from VimPlug/jedi

FunctionExecutionContext should use the parent if possible

This commit is contained in:
Dave Halter
2018-08-06 12:49:31 +02:00
parent 4a593f9693
commit 8fc2add242

View File

@@ -323,12 +323,16 @@ class BoundMethod(AbstractFunction):
if arguments is None:
arguments = AnonymousInstanceArguments(self._instance)
return FunctionExecutionContext(
self.evaluator,
self.parent_context,
self,
InstanceArguments(self._instance, arguments)
)
arguments = InstanceArguments(self._instance, arguments)
if isinstance(self._function, compiled.CompiledObject):
# This is kind of weird, because it's coming from a compiled object
# and we're not sure if we want that in the future.
return FunctionExecutionContext(
self.evaluator, self.parent_context, self, arguments
)
return self._function.get_function_execution(arguments)
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self._function)