--- bpython/importcompletion.py +++ bpython/importcompletion.py @@ -77,7 +77,7 @@ name = os.path.splitext(name)[0] try: fo, pathname, _ = imp.find_module(name, [path]) - except ImportError: + except (ImportError, SyntaxError): continue else: if fo is not None: