@@ -1976,10 +1976,8 @@ def tokens_for_completion(self, line: str, begidx: int, endidx: int) -> tuple[li
19761976 **On Failure**
19771977 - Two empty lists
19781978 """
1979- import copy
1980-
19811979 unclosed_quote = ""
1982- quotes_to_try = copy . copy ( constants .QUOTES )
1980+ quotes_to_try = [ * constants .QUOTES ]
19831981
19841982 tmp_line = line [:endidx ]
19851983 tmp_endidx = endidx
@@ -3818,8 +3816,7 @@ def _alias_create(self, args: argparse.Namespace) -> None:
38183816 return
38193817
38203818 # Unquote redirection and terminator tokens
3821- tokens_to_unquote = constants .REDIRECTION_TOKENS
3822- tokens_to_unquote .extend (self .statement_parser .terminators )
3819+ tokens_to_unquote = (* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators )
38233820 utils .unquote_specific_tokens (args .command_args , tokens_to_unquote )
38243821
38253822 # Build the alias value string
@@ -3898,8 +3895,7 @@ def _alias_list(self, args: argparse.Namespace) -> None:
38983895 """List some or all aliases as 'alias create' commands."""
38993896 self .last_result = {} # dict[alias_name, alias_value]
39003897
3901- tokens_to_quote = constants .REDIRECTION_TOKENS
3902- tokens_to_quote .extend (self .statement_parser .terminators )
3898+ tokens_to_quote = (* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators )
39033899
39043900 to_list = (
39053901 utils .remove_duplicates (args .names )
@@ -4065,8 +4061,7 @@ def _macro_create(self, args: argparse.Namespace) -> None:
40654061 return
40664062
40674063 # Unquote redirection and terminator tokens
4068- tokens_to_unquote = constants .REDIRECTION_TOKENS
4069- tokens_to_unquote .extend (self .statement_parser .terminators )
4064+ tokens_to_unquote = (* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators )
40704065 utils .unquote_specific_tokens (args .command_args , tokens_to_unquote )
40714066
40724067 # Build the macro value string
@@ -4188,8 +4183,7 @@ def _macro_list(self, args: argparse.Namespace) -> None:
41884183 """List macros."""
41894184 self .last_result = {} # dict[macro_name, macro_value]
41904185
4191- tokens_to_quote = constants .REDIRECTION_TOKENS
4192- tokens_to_quote .extend (self .statement_parser .terminators )
4186+ tokens_to_quote = (* constants .REDIRECTION_TOKENS , * self .statement_parser .terminators )
41934187
41944188 to_list = (
41954189 utils .remove_duplicates (args .names )
@@ -4917,9 +4911,7 @@ def py_quit() -> None:
49174911 """Exit an interactive Python environment, callable from the interactive Python console."""
49184912 raise EmbeddedConsoleExit
49194913
4920- from .py_bridge import (
4921- PyBridge ,
4922- )
4914+ from .py_bridge import PyBridge
49234915
49244916 add_to_history = self .scripts_add_to_history if pyscript else True
49254917 py_bridge = PyBridge (self , add_to_history = add_to_history )
0 commit comments