From 45bf843b03c4c2bdf5946233858a529554152c8b Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 29 Sep 2015 17:08:24 +0200 Subject: [PATCH] Move python comp away from eval and sed I have no clue why this used eval. --- share/completions/python.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/python.fish b/share/completions/python.fish index 64ab4d9be..d36aa9236 100644 --- a/share/completions/python.fish +++ b/share/completions/python.fish @@ -17,7 +17,7 @@ complete -c python -s x -d 'Skip first line of source, allowing use of non-Unix complete -c python -a "(__fish_complete_suffix .py)" complete -c python -a '-' -d 'Read program from stdin' -switch (eval python -V 2>&1 | head -n1 | sed 's/^.*[[:space:]]\([23]\)\..*/\1/') +switch (python -V 2>&1 | string replace -r '^.*\s([23])..*' '$1')[1] case 2 complete -c python -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix' complete -c python -s t --description "Warn on mixed tabs and spaces"