From 5af665abd8c1afe93d6c07d81d9b74452da30c38 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 10 Dec 2014 11:42:02 +0100 Subject: [PATCH] Dynamic array checking in combination with FakeSequences might have caused an exception. --- jedi/evaluate/iterable.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/iterable.py b/jedi/evaluate/iterable.py index 7037903e..d73e9cb1 100644 --- a/jedi/evaluate/iterable.py +++ b/jedi/evaluate/iterable.py @@ -425,7 +425,13 @@ def check_array_additions(evaluator, array): return [] is_list = array.type == 'list' - current_module = array.atom.get_parent_until() + try: + current_module = array.atom.get_parent_until() + except AttributeError: + # If there's no get_parent_until, it's a FakeSequence or another Fake + # type. Those fake types are used inside Jedi's engine. No values may + # be added to those after their creation. + return [] return _check_array_additions(evaluator, array, current_module, is_list)