diff -r 96c51207e7cd Lib/idlelib/AutoComplete.py --- a/Lib/idlelib/AutoComplete.py Fri Aug 16 21:33:27 2013 +0300 +++ b/Lib/idlelib/AutoComplete.py Fri Aug 16 20:01:45 2013 -0400 @@ -6,6 +6,7 @@ import os import sys import string +import importlib from idlelib.configHandler import idleConf @@ -228,4 +229,11 @@ """Lookup name in a namespace spanning sys.modules and __main.dict__""" namespace = sys.modules.copy() namespace.update(__main__.__dict__) + if name not in namespace: + # If name (the module to import) is misspelled or does not exist, + # an ImportError will be raised. The fetch_completions function + # will catch the error and return empty completion lists. + importlib.import_module(name) + namespace = sys.modules.copy() + namespace.update(__main__.__dict__) return eval(name, namespace)