1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Merge pull request #427 from makalaaneesh/master

#425 command had to be re escaped
This commit is contained in:
Vladimir Iakovlev 2016-01-08 16:38:05 +03:00
commit 8b05f6d46f

View File

@ -110,7 +110,7 @@ def get_all_executables():
def replace_argument(script, from_, to):
"""Replaces command line argument."""
replaced_in_the_end = re.sub(u' {}$'.format(from_), u' {}'.format(to),
replaced_in_the_end = re.sub(u' {}$'.format(re.escape(from_)), u' {}'.format(to),
script, count=1)
if replaced_in_the_end != script:
return replaced_in_the_end