Fixed a ZeroDivionError by adjusting what is returned by aliashandler.all() when no aliases are given ([] instead of ['']). Also made sure src.utils.stringsuggestions() don't crash in such a situation.

This commit is contained in:
Griatch 2013-10-18 16:15:51 +02:00
parent a1646ec596
commit 55423f6a2f
4 changed files with 9 additions and 7 deletions

View file

@ -316,7 +316,6 @@ def cmdhandler(called_by, raw_string, testing=False, callertype="session", sessi
else:
# fallback to default error text
sysarg = _("Command '%s' is not available.") % raw_string
cmdset.get_all_cmd_keys_and_aliases(caller)
suggestions = string_suggestions(raw_string, cmdset.get_all_cmd_keys_and_aliases(caller), cutoff=0.7, maxnum=3)
if suggestions:
sysarg += _(" Maybe you meant %s?") % utils.list_to_string(suggestions, _('or'), addquote=True)