Commit 08a6f743 authored by Jacek Sowiński's avatar Jacek Sowiński

Try to edit todo file even if $EDITOR is unset.

On some systems EDITOR is unset by default, so in such situation topydo
would throw KeyError exception instead of opening todo.txt in vi.
parent 0e4557e0
......@@ -29,7 +29,10 @@ class EditCommand(Command):
if not super(EditCommand, self).execute():
return False
editor = os.environ['EDITOR'] or 'vi'
try:
editor = os.environ['EDITOR'] or 'vi'
except(KeyError):
editor = 'vi'
todo = config().todotxt()
return call([editor, todo]) == 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment