Use 'shlex' to split default Executable arguments (#10929)
This allows shell commands for `spack edit` to be executed correctly if they have quoted arguments.
This commit is contained in:
parent
670ef9bd7c
commit
844ca31894
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
from six import string_types, text_type
|
from six import string_types, text_type
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ class Executable(object):
|
|||||||
"""Class representing a program that can be run on the command line."""
|
"""Class representing a program that can be run on the command line."""
|
||||||
|
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.exe = name.split(' ')
|
self.exe = shlex.split(name)
|
||||||
self.default_env = {}
|
self.default_env = {}
|
||||||
self.returncode = None
|
self.returncode = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user