py console autocomp. fix

import missing_mod
...would raise an error.
This commit is contained in:
Campbell Barton 2010-04-25 15:21:46 +00:00
parent cacd2477c0
commit 93bc6fb829

@ -32,6 +32,7 @@ changes have been made:
- limit list of modules to prefix in case of "from w" - limit list of modules to prefix in case of "from w"
- sorted modules - sorted modules
- added sphinx documentation - added sphinx documentation
- complete() returns a blank list of the module isnt found
""" """
@ -183,3 +184,8 @@ def complete(line):
if len(words) >= 3 and words[0] == 'from': if len(words) >= 3 and words[0] == 'from':
mod = words[1] mod = words[1]
return filter_prefix(try_import(mod), words[-1]) return filter_prefix(try_import(mod), words[-1])
# get here if the import is not found
# import invalidmodule
# ^, in this case return nothing
return []