1
0
forked from VimPlug/jedi

Allow unsafe custom __getitem__ executions when allow unsafe executions is on

This commit is contained in:
Dave Halter
2023-07-29 00:33:09 +02:00
parent 8a4b079d0f
commit 57aefed6ea
3 changed files with 25 additions and 5 deletions

View File

@@ -162,7 +162,10 @@ class CompiledValue(Value):
def py__simple_getitem__(self, index):
with reraise_getitem_errors(IndexError, KeyError, TypeError):
try:
access = self.access_handle.py__simple_getitem__(index)
access = self.access_handle.py__simple_getitem__(
index,
safe=not self.inference_state.allow_unsafe_executions
)
except AttributeError:
return super().py__simple_getitem__(index)
if access is None: