Mercurial > python-cmd2
diff cmd2.py @ 127:8def9dec155f 0.4.3
trap errors
author | catherine@dellzilla |
---|---|
date | Fri, 07 Nov 2008 10:31:38 -0500 |
parents | 197a312f2656 |
children | 64ad2b28d69d |
line wrap: on
line diff
--- a/cmd2.py Wed Nov 05 14:16:24 2008 -0500 +++ b/cmd2.py Fri Nov 07 10:31:38 2008 -0500 @@ -330,7 +330,11 @@ self.stdout = tempfile.TemporaryFile() if statement.output == '>>': self.stdout.write(getPasteBuffer()) - stop = cmd.Cmd.onecmd(self, statement.statement) + try: + stop = cmd.Cmd.onecmd(self, statement.statement) + except Exception, e: + print str(e) + return False try: if statement.command not in self.excludeFromHistory: self.history.append(statement.fullStatement)