mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fix getitem in compiled
This change just applies a change to CompiledObject that was done to values a long time ago
This commit is contained in:
@@ -181,10 +181,12 @@ class CompiledObject(Value):
|
|||||||
def _ensure_one_filter(self, is_instance):
|
def _ensure_one_filter(self, is_instance):
|
||||||
return CompiledObjectFilter(self.inference_state, self, is_instance)
|
return CompiledObjectFilter(self.inference_state, self, is_instance)
|
||||||
|
|
||||||
@CheckAttribute(u'__getitem__')
|
|
||||||
def py__simple_getitem__(self, index):
|
def py__simple_getitem__(self, index):
|
||||||
with reraise_getitem_errors(IndexError, KeyError, TypeError):
|
with reraise_getitem_errors(IndexError, KeyError, TypeError):
|
||||||
|
try:
|
||||||
access = self.access_handle.py__simple_getitem__(index)
|
access = self.access_handle.py__simple_getitem__(index)
|
||||||
|
except AttributeError:
|
||||||
|
return super(CompiledObject, self).py__simple_getitem__(index)
|
||||||
if access is None:
|
if access is None:
|
||||||
return NO_VALUES
|
return NO_VALUES
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user