#588: Stop using bashlex
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
import shlex
|
||||
import bashlex
|
||||
import six
|
||||
from ..utils import memoize
|
||||
from ..conf import settings
|
||||
@@ -65,18 +64,9 @@ class Generic(object):
|
||||
return
|
||||
|
||||
def split_command(self, command):
|
||||
"""Split the command using shell-like syntax.
|
||||
|
||||
If bashlex fails for some reason, fallback to shlex
|
||||
See https://github.com/idank/bashlex#limitations
|
||||
"""
|
||||
"""Split the command using shell-like syntax."""
|
||||
encoded = self.encode_utf8(command)
|
||||
|
||||
try:
|
||||
splitted = list(bashlex.split(encoded))
|
||||
except Exception:
|
||||
splitted = shlex.split(encoded)
|
||||
|
||||
splitted = shlex.split(encoded)
|
||||
return self.decode_utf8(splitted)
|
||||
|
||||
def encode_utf8(self, command):
|
||||
|
||||
Reference in New Issue
Block a user