summaryrefslogtreecommitdiff
path: root/astroid/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'astroid/helpers.py')
-rw-r--r--astroid/helpers.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index 2d79b621..d7a72338 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -256,11 +256,7 @@ def object_len(node, context=None):
"object of type '{}' has no len()"
.format(len_call.pytype()))
- try:
- result_of_len = next(len_call.infer_call_result(node, context))
- # Remove StopIteration catch when #507 is fixed
- except StopIteration:
- raise exceptions.InferenceError(node=node)
+ result_of_len = next(len_call.infer_call_result(node, context))
if isinstance(result_of_len, nodes.Const) and result_of_len.pytype() == "builtins.int":
return result_of_len.value
raise exceptions.AstroidTypeError(