diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-01-18 18:54:30 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-01-18 18:54:30 +0100 |
commit | 02699bad102678273dcd6bbeb7d3f6100f4547fb (patch) | |
tree | b973f9b8b9065f0835bd4bfb0f8addf14f7e9ab1 /astroid/inference.py | |
parent | 0e1ab4ac02b1946851496585459930f0d7b6f03e (diff) | |
download | astroid-git-02699bad102678273dcd6bbeb7d3f6100f4547fb.tar.gz |
Remove StopIteration handling which should not leak at all from inference
Diffstat (limited to 'astroid/inference.py')
-rw-r--r-- | astroid/inference.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/astroid/inference.py b/astroid/inference.py index 09c6eb60..dbcf8a62 100644 --- a/astroid/inference.py +++ b/astroid/inference.py @@ -874,15 +874,7 @@ def instance_getitem(self, index, context=None): "Could not find __getitem__ for {node!r}.", node=self, context=context ) - try: - return next(method.infer_call_result(self, new_context)) - except StopIteration as exc: - raise exceptions.InferenceError( - message="Inference for {node!r}[{index!s}] failed.", - node=self, - index=index, - context=context, - ) from exc + return next(method.infer_call_result(self, new_context)) bases.Instance.getitem = instance_getitem |