1
0
forked from VimPlug/jedi

Fix more issues with where contexts are used and where values are used

This commit is contained in:
Dave Halter
2019-08-20 09:59:10 +02:00
parent 39b294e085
commit 14fc5ed289
7 changed files with 36 additions and 13 deletions

View File

@@ -530,13 +530,18 @@ def _normalize_create_args(func):
def create_from_access_path(inference_state, access_path):
parent_context = None
value = None
for name, access in access_path.accesses:
parent_context = create_cached_compiled_object(inference_state, access, parent_context)
return parent_context
value = create_cached_compiled_object(
inference_state,
access,
parent_context=None if value is None else value.as_context()
)
return value
@_normalize_create_args
@inference_state_function_cache()
def create_cached_compiled_object(inference_state, access_handle, parent_context):
assert not isinstance(parent_context, CompiledObject)
return CompiledObject(inference_state, access_handle, parent_context)