From c0d51e300b91ba322d5e9a7490720d7598df6947 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 17 Jul 2013 15:05:06 +0200 Subject: [PATCH] fixed problem with empty statements in function calls --- jedi/evaluate_representation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jedi/evaluate_representation.py b/jedi/evaluate_representation.py index d9967c96..0c04382c 100644 --- a/jedi/evaluate_representation.py +++ b/jedi/evaluate_representation.py @@ -628,15 +628,18 @@ class Execution(Executable): stmt._commands = [old] # *args - if stmt.get_commands()[0] == '*': - arrays = evaluate.follow_call_list(stmt.get_commands()[1:]) + commands = stmt.get_commands() + if not len(commands): + continue + if commands[0] == '*': + arrays = evaluate.follow_call_list(commands[1:]) # *args must be some sort of an array, otherwise -> ignore for array in arrays: for field_stmt in array: # yield from plz! yield None, field_stmt # **kwargs - elif stmt.get_commands()[0] == '**': - arrays = evaluate.follow_call_list(stmt.get_commands()[1:]) + elif commands[0] == '**': + arrays = evaluate.follow_call_list(commands[1:]) for array in arrays: for key_stmt, value_stmt in array.items(): # first index, is the key if syntactically correct