mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 09:08:32 +02:00
Close temp file before deleting it.
This commit is contained in:
parent
94d6ebeb2d
commit
ee782cc5c5
1 changed files with 2 additions and 1 deletions
|
@ -125,9 +125,10 @@ def get_text_from_editor(config, template=""):
|
|||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||
if template:
|
||||
f.write(template)
|
||||
subprocess.call(config['editor'].split() + [tmpfile])
|
||||
subprocess.call(config['editor'].split() + [tmpfile])
|
||||
with codecs.open(tmpfile, "r", "utf-8") as f:
|
||||
raw = f.read()
|
||||
os.close(_);
|
||||
os.remove(tmpfile)
|
||||
if not raw:
|
||||
prompt('[Nothing saved to file]')
|
||||
|
|
Loading…
Add table
Reference in a new issue