@@ -1666,10 +1666,8 @@ def tokens_for_completion(self, line: str, begidx: int, endidx: int) -> tuple[li
16661666 **On Failure**
16671667 - Two empty lists
16681668 """
1669- import copy
1670-
16711669 unclosed_quote = ''
1672- quotes_to_try = copy . copy ( constants .QUOTES )
1670+ quotes_to_try = [ * constants .QUOTES ]
16731671
16741672 tmp_line = line [:endidx ]
16751673 tmp_endidx = endidx
@@ -3721,8 +3719,7 @@ def _alias_create(self, args: argparse.Namespace) -> None:
37213719 return
37223720
37233721 # Unquote redirection and terminator tokens
3724- tokens_to_unquote = constants .REDIRECTION_TOKENS
3725- tokens_to_unquote .extend (self .statement_parser .terminators )
3722+ tokens_to_unquote = [* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators ]
37263723 utils .unquote_specific_tokens (args .command_args , tokens_to_unquote )
37273724
37283725 # Build the alias value string
@@ -3801,8 +3798,7 @@ def _alias_list(self, args: argparse.Namespace) -> None:
38013798 """List some or all aliases as 'alias create' commands."""
38023799 self .last_result = {} # dict[alias_name, alias_value]
38033800
3804- tokens_to_quote = constants .REDIRECTION_TOKENS
3805- tokens_to_quote .extend (self .statement_parser .terminators )
3801+ tokens_to_quote = [* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators ]
38063802
38073803 to_list = utils .remove_duplicates (args .names ) if args .names else sorted (self .aliases , key = self .default_sort_key )
38083804
@@ -3964,8 +3960,7 @@ def _macro_create(self, args: argparse.Namespace) -> None:
39643960 return
39653961
39663962 # Unquote redirection and terminator tokens
3967- tokens_to_unquote = constants .REDIRECTION_TOKENS
3968- tokens_to_unquote .extend (self .statement_parser .terminators )
3963+ tokens_to_unquote = [* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators ]
39693964 utils .unquote_specific_tokens (args .command_args , tokens_to_unquote )
39703965
39713966 # Build the macro value string
@@ -4087,8 +4082,7 @@ def _macro_list(self, args: argparse.Namespace) -> None:
40874082 """List macros."""
40884083 self .last_result = {} # dict[macro_name, macro_value]
40894084
4090- tokens_to_quote = constants .REDIRECTION_TOKENS
4091- tokens_to_quote .extend (self .statement_parser .terminators )
4085+ tokens_to_quote = [* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators ]
40924086
40934087 to_list = utils .remove_duplicates (args .names ) if args .names else sorted (self .macros , key = self .default_sort_key )
40944088
0 commit comments