@@ -1068,7 +1068,7 @@ def _unregister_subcommands(self, cmdset: Union[CommandSet, 'Cmd']) -> None:
10681068
10691069 for action in command_parser ._actions :
10701070 if isinstance (action , argparse ._SubParsersAction ):
1071- action .remove_parser (subcommand_name ) # type: ignore[arg-type, attr-defined]
1071+ action .remove_parser (subcommand_name ) # type: ignore[attr-defined]
10721072 break
10731073
10741074 @property
@@ -3351,7 +3351,7 @@ def complete_none(text: str, state: int) -> str | None: # pragma: no cover # n
33513351 parser .add_argument (
33523352 'arg' ,
33533353 suppress_tab_hint = True ,
3354- choices = choices , # type: ignore[arg-type]
3354+ choices = choices ,
33553355 choices_provider = choices_provider ,
33563356 completer = completer ,
33573357 )
@@ -4566,15 +4566,15 @@ def do_shell(self, args: argparse.Namespace) -> None:
45664566 # still receive the SIGINT since it is in the same process group as us.
45674567 with self .sigint_protection :
45684568 # For any stream that is a StdSim, we will use a pipe so we can capture its output
4569- proc = subprocess .Popen ( # type: ignore[call-overload] # noqa: S602
4569+ proc = subprocess .Popen ( # noqa: S602
45704570 expanded_command ,
45714571 stdout = subprocess .PIPE if isinstance (self .stdout , utils .StdSim ) else self .stdout , # type: ignore[unreachable]
45724572 stderr = subprocess .PIPE if isinstance (sys .stderr , utils .StdSim ) else sys .stderr , # type: ignore[unreachable]
45734573 shell = True ,
45744574 ** kwargs ,
45754575 )
45764576
4577- proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr ) # type: ignore[arg-type]
4577+ proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr )
45784578 proc_reader .wait ()
45794579
45804580 # Save the return code of the application for use in a pyscript
@@ -4656,9 +4656,9 @@ def _set_up_py_shell_env(self, interp: InteractiveConsole) -> _SavedCmd2Env:
46564656 # Save off the current completer and set a new one in the Python console
46574657 # Make sure it tab completes from its locals() dictionary
46584658 cmd2_env .readline_settings .completer = readline .get_completer ()
4659- interp .runcode ("from rlcompleter import Completer" ) # type: ignore[arg-type]
4660- interp .runcode ("import readline" ) # type: ignore[arg-type]
4661- interp .runcode ("readline.set_completer(Completer(locals()).complete)" ) # type: ignore[arg-type]
4659+ interp .runcode (compile ( "from rlcompleter import Completer" , "<stdin>" , "exec" ))
4660+ interp .runcode (compile ( "import readline" , "<stdin>" , "exec" ))
4661+ interp .runcode (compile ( "readline.set_completer(Completer(locals()).complete)" , "<stdin>" , "exec" ))
46624662
46634663 # Set up sys module for the Python console
46644664 self ._reset_py_display ()
0 commit comments