diff --git a/spyderlib/widgets/shell.py b/spyderlib/widgets/shell.py index dd21ef97ef6..89cf00e00c3 100644 --- a/spyderlib/widgets/shell.py +++ b/spyderlib/widgets/shell.py @@ -884,6 +884,9 @@ def show_code_completion(self, automatic): text = to_text_string(self.get_current_line_to_cursor()) last_obj = self.get_last_obj() + if not text: + return + if text.startswith('import '): obj_list = self.get_module_completion(text) words = text.split(' ')