diff --git a/evaluate.py b/evaluate.py index e5dd8679..c2c91a22 100644 --- a/evaluate.py +++ b/evaluate.py @@ -1217,7 +1217,10 @@ def follow_call_list(call_list): if str(call.name) == 'if': # Ternary operators. while True: - call = next(calls_iterator) + try: + call = next(calls_iterator) + except StopIteration: + break try: if str(call.name) == 'else': break diff --git a/test/completion/invalid.py b/test/completion/invalid.py index 8afe20b3..d8e9f36a 100644 --- a/test/completion/invalid.py +++ b/test/completion/invalid.py @@ -56,5 +56,10 @@ try: #? str() "" +# wrong ternary +a = 1 if +#? int() +a + #? [] int()). diff --git a/test/completion/thirdparty/jedi_.py b/test/completion/thirdparty/jedi_.py index dd678edd..da6f1bb7 100644 --- a/test/completion/thirdparty/jedi_.py +++ b/test/completion/thirdparty/jedi_.py @@ -32,5 +32,5 @@ el = list(evaluate.get_names_for_scope(1))[0][1] el = list(evaluate.get_names_for_scope())[0][1] # TODO here should stand evaluate.Instance() and so on. -##? [] +#? el = list(evaluate.get_names_for_scope())[0][1][0]