Don't immediately raise an error when an editor is not found (#4587)
* Don't immediately raise an error when an editor is not found * If no editor is found, raise an error only if we try to use it.
This commit is contained in:
parent
1d82ccd25c
commit
ad1382e664
@ -223,12 +223,13 @@
|
||||
else:
|
||||
editor = which('vim', 'vi', 'emacs', 'nano')
|
||||
|
||||
# If there is no editor, only raise an error if we actually try to use it.
|
||||
if not editor:
|
||||
default = default_editors[0]
|
||||
msg = 'Default text editor, {0}, not found.\n'.format(default)
|
||||
msg += 'Please set the EDITOR environment variable to your preferred '
|
||||
msg += 'text editor, or install {0}.'.format(default)
|
||||
raise EnvironmentError(msg)
|
||||
def editor_not_found(*args, **kwargs):
|
||||
raise EnvironmentError(
|
||||
'No text editor found! Please set the EDITOR environment variable '
|
||||
'to your preferred text editor.')
|
||||
editor = editor_not_found
|
||||
|
||||
from spack.package import \
|
||||
install_dependency_symlinks, flatten_dependencies, \
|
||||
|
Loading…
Reference in New Issue
Block a user