summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-07-21 20:39:57 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-07-21 20:39:57 -0400
commit9932febf8202b9d1b4a33ae7ff53e627ec01a2d3 (patch)
tree9aad0f618029b34d85abc13419cd5490cde60ba3
parent479825bee23f97ce5e6bf31aaca37fe9d9803a8f (diff)
downloadblogit-master.tar.gz
blogit-master.tar.bz2
Improve handling of abort on contents editHEADmaster
-rw-r--r--raw_post4
1 files changed, 3 insertions, 1 deletions
diff --git a/raw_post b/raw_post
index 63490c3..f26765c 100644
--- a/raw_post
+++ b/raw_post
@@ -65,9 +65,11 @@ else:
editor = os.environ["EDITOR"]
contents_path = os.path.join (repo, CONTENTS_FILE)
+ if os.path.exists (contents_path):
+ os.remove (contents_path)
ret = subprocess.call ([editor, contents_path])
- if ret == 0:
+ if ret == 0 and os.path.exists (contents_path):
contents = open (contents_path).read ()
os.remove (contents_path)
else: