Fix #2065 : Console crash with missing closing quote

This commit is contained in:
Dan39 2012-04-19 15:52:44 +01:00 committed by Calum Lind
parent 914413c88f
commit 483c439e38
1 changed files with 6 additions and 1 deletions

View File

@ -295,7 +295,12 @@ Please use commands from the command line, eg:\n
except KeyError: except KeyError:
self.write("{!error!}Unknown command: %s" % cmd) self.write("{!error!}Unknown command: %s" % cmd)
return return
args = self._commands[cmd].split(line)
try:
args = self._commands[cmd].split(line)
except ValueError, e:
self.write("{!error!}Error parsing command: %s" % e)
return
# Do a little hack here to print 'command --help' properly # Do a little hack here to print 'command --help' properly
parser._print_help = parser.print_help parser._print_help = parser.print_help