1
0
forked from VimPlug/jedi

More fixes, because of CompiledObject modifications

This commit is contained in:
Dave Halter
2018-09-17 02:40:34 +02:00
parent eb9a852443
commit cc3b08fd1b
2 changed files with 10 additions and 5 deletions

View File

@@ -295,9 +295,13 @@ class SequenceLiteralContext(Sequence):
compiled_obj_index = compiled.create_simple_object(self.evaluator, index)
for key, value in self.get_tree_entries():
for k in self._defining_context.eval_node(key):
if isinstance(k, compiled.CompiledObject) \
and k.execute_operation(compiled_obj_index, u'==').get_safe_value():
return self._defining_context.eval_node(value)
try:
method = k.execute_operation
except AttributeError:
pass
else:
if method(compiled_obj_index, u'==').get_safe_value():
return self._defining_context.eval_node(value)
raise SimpleGetItemNotFound('No key found in dictionary %s.' % self)
if isinstance(index, slice):