From 98b592cb682abeb87898adfbd3e4bcd17f000495 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 29 Nov 2019 16:14:17 +0100 Subject: [PATCH] Fix getitem in compiled This change just applies a change to CompiledObject that was done to values a long time ago --- jedi/inference/compiled/value.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jedi/inference/compiled/value.py b/jedi/inference/compiled/value.py index ffe71e5a..f468fb8b 100644 --- a/jedi/inference/compiled/value.py +++ b/jedi/inference/compiled/value.py @@ -181,10 +181,12 @@ class CompiledObject(Value): def _ensure_one_filter(self, is_instance): return CompiledObjectFilter(self.inference_state, self, is_instance) - @CheckAttribute(u'__getitem__') def py__simple_getitem__(self, index): with reraise_getitem_errors(IndexError, KeyError, TypeError): - access = self.access_handle.py__simple_getitem__(index) + try: + access = self.access_handle.py__simple_getitem__(index) + except AttributeError: + return super(CompiledObject, self).py__simple_getitem__(index) if access is None: return NO_VALUES