From c4f073ee7be827cf08965206bea8e37e7b97e53c Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 28 Jan 2008 21:19:34 +0100 Subject: [PATCH] Simplify editor selection logic MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström Signed-off-by: Karl Hasselström --- stgit/utils.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stgit/utils.py b/stgit/utils.py index 00776b0..43366c9 100644 --- a/stgit/utils.py +++ b/stgit/utils.py @@ -175,12 +175,8 @@ def call_editor(filename): # the editor editor = config.get('stgit.editor') - if editor: - pass - elif 'EDITOR' in os.environ: - editor = os.environ['EDITOR'] - else: - editor = 'vi' + if not editor: + editor = os.environ.get('EDITOR', 'vi') editor += ' %s' % filename out.start('Invoking the editor: "%s"' % editor) -- [mdw]