Meta: Avoid an IndexError with .get() instead of indexing in the weeknotes script

Replace indexing into the os.environ dictionary with a .get() call (and a default)
to avoid an IndexError
This commit is contained in:
Eryn Wells 2024-11-18 08:05:22 -08:00
parent 2d6912aed2
commit b7fb364862

View file

@ -39,7 +39,7 @@ def parse_args(argv, *a, **kw):
)
edit_command.add_argument(
'--editor', '-e',
default=os.environ['EDITOR'] or 'nvim',
default=os.environ.get('EDITOR', 'nvim'),
)
edit_command.add_argument('--week', '-w')
edit_command.set_defaults(handler=handle_edit_command)