mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 23:16:14 +01:00
- run_editor: added fallback if shlex.split raises a SyntaxError
Fall back to a plain split in order to support an arbitrary $EDITOR value.
This commit is contained in:
parent
0e30e56ded
commit
132a2d128f
@ -3481,7 +3481,10 @@ def run_pager(message, tmp_suffix=''):
|
|||||||
|
|
||||||
def run_editor(filename):
|
def run_editor(filename):
|
||||||
editor = os.getenv('EDITOR', default=get_default_editor())
|
editor = os.getenv('EDITOR', default=get_default_editor())
|
||||||
cmd = shlex.split(editor)
|
try:
|
||||||
|
cmd = shlex.split(editor)
|
||||||
|
except SyntaxError:
|
||||||
|
cmd = editor.split()
|
||||||
cmd.append(filename)
|
cmd.append(filename)
|
||||||
return run_external(cmd[0], *cmd[1:])
|
return run_external(cmd[0], *cmd[1:])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user