diff options
-rw-r--r-- | libbe/ui/util/editor.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libbe/ui/util/editor.py b/libbe/ui/util/editor.py index ce14365..1a430c7 100644 --- a/libbe/ui/util/editor.py +++ b/libbe/ui/util/editor.py @@ -64,13 +64,12 @@ def editor_string(comment=None, encoding=None): """ if encoding == None: encoding = libbe.util.encoding.get_filesystem_encoding() + editor = None for name in ('VISUAL', 'EDITOR'): - try: + if name in os.environ and os.environ[name] != '': editor = os.environ[name] break - except KeyError: - pass - else: + if editor == None: raise CantFindEditor() fhandle, fname = tempfile.mkstemp() try: |