#588: Stop using bashlex

This commit is contained in:
Vladimir Iakovlev
2017-01-11 14:58:50 +01:00
parent 03a828d586
commit a778ea6203
3 changed files with 5 additions and 20 deletions
+2 -12
View File
@@ -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):