From 0aa8df2edbe489f21c0c0a188cad09ac0827ab1c Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 5 Feb 2007 22:41:41 +0000 Subject: [PATCH] Stop the e-mail sending if editor fails With this patch, if the editor exits with a non-zero status, stop sending any e-mails. Signed-off-by: Catalin Marinas --- stgit/commands/mail.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 7f20f13..cf470f1 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -290,7 +290,10 @@ def __edit_message(msg): print 'Invoking the editor: "%s"...' % editor, sys.stdout.flush() - print 'done (exit code: %d)' % os.system(editor) + err = os.system(editor) + if err: + raise CmdException, 'editor failed, exit code: %d' % err + print 'done' # read the message back f = file(fname) -- 2.11.0