aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/ui
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/ui')
-rw-r--r--libbe/ui/util/editor.py7
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: