From: Catalin Marinas Date: Mon, 5 Feb 2007 22:41:41 +0000 (+0000) Subject: Stop the e-mail sending if editor fails X-Git-Tag: v0.14.3~342 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/0aa8df2edbe489f21c0c0a188cad09ac0827ab1c 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 --- 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)