summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index bcbce8ee..4fe3db97 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -330,7 +330,11 @@ class Cmd(cmd.Cmd):
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)