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:
Seth R. Johnson 2019-03-26 15:02:32 -04:00 committed by Peter Scheibel
parent 670ef9bd7c
commit 844ca31894

View file

@ -5,6 +5,7 @@
import os
import re
import shlex
import subprocess
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."""
def __init__(self, name):
self.exe = name.split(' ')
self.exe = shlex.split(name)
self.default_env = {}
self.returncode = None