diff options
-rw-r--r-- | lib/spack/spack/__init__.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 1f583fff61..e77a0c75cd 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -223,12 +223,13 @@ if editor is not None: 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, \ |