diff --git a/setup.py b/setup.py index 025ae275..f5862e13 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ elif (3, 0) < version < (3, 3): VERSION = '3.12' -install_requires = ['psutil', 'colorama', 'six', 'decorator', 'bashlex'] +install_requires = ['psutil', 'colorama', 'six', 'decorator'] extras_require = {':python_version<"3.4"': ['pathlib2'], ":sys_platform=='win32'": ['win_unicode_console']} diff --git a/tests/shells/test_bash.py b/tests/shells/test_bash.py index c4268c04..96661b53 100644 --- a/tests/shells/test_bash.py +++ b/tests/shells/test_bash.py @@ -58,11 +58,6 @@ class TestBash(object): assert list(shell.get_history()) == ['ls', 'rm'] def test_split_command(self, shell): - command = 'git log $(git ls-files thefuck | grep python_command) -p' - command_parts = ['git', 'log', '$(git ls-files thefuck | grep python_command)', '-p'] + command = 'git log -p' + command_parts = ['git', 'log', '-p'] assert shell.split_command(command) == command_parts - - # bashlex doesn't support parsing arithmetic expressions, so make sure - # shlex is used a fallback - # See https://github.com/idank/bashlex#limitations - assert shell.split_command('$((1 + 2))') == ['$((1', '+', '2))'] diff --git a/thefuck/shells/generic.py b/thefuck/shells/generic.py index 9aa65b3b..a4f0b1e4 100644 --- a/thefuck/shells/generic.py +++ b/thefuck/shells/generic.py @@ -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):