1
0
forked from VimPlug/jedi

Don't catch IndexError where we don't have to

This commit is contained in:
Dave Halter
2018-04-20 01:46:14 +02:00
parent 5f37d08761
commit 88243d2408
5 changed files with 51 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ from jedi.evaluate.base_context import Context, ContextSet
from jedi.evaluate.lazy_context import LazyKnownContext
from jedi.evaluate.compiled.access import _sentinel
from jedi.evaluate.cache import evaluator_function_cache
from jedi.evaluate.helpers import reraise_as_evaluator
from . import fake
@@ -145,7 +146,8 @@ class CompiledObject(Context):
@CheckAttribute
def py__getitem__(self, index):
access = self.access_handle.py__getitem__(index)
with reraise_as_evaluator(IndexError, KeyError, TypeError):
access = self.access_handle.py__getitem__(index)
if access is None:
return ContextSet()