@@ -987,7 +987,7 @@ def _unregister_subcommands(self, cmdset: Union[CommandSet, 'Cmd']) -> None:
987987
988988 for action in command_parser ._actions :
989989 if isinstance (action , argparse ._SubParsersAction ):
990- action .remove_parser (subcommand_name ) # type: ignore[arg-type, attr-defined]
990+ action .remove_parser (subcommand_name ) # type: ignore[attr-defined]
991991 break
992992
993993 @property
@@ -2095,15 +2095,15 @@ def _perform_completion(
20952095 completer .complete , tokens = raw_tokens [1 :] if preserve_quotes else tokens [1 :], cmd_set = cmd_set
20962096 )
20972097 else :
2098- completer_func = self .completedefault # type: ignore[assignment]
2098+ completer_func = self .completedefault
20992099
21002100 # Not a recognized command
21012101 else :
21022102 # Check if this command should be run as a shell command
21032103 if self .default_to_shell and command in utils .get_exes_in_path (command ):
21042104 completer_func = self .path_complete
21052105 else :
2106- completer_func = self .completedefault # type: ignore[assignment]
2106+ completer_func = self .completedefault
21072107
21082108 # Otherwise we are completing the command token or performing custom completion
21092109 else :
@@ -2805,11 +2805,11 @@ def _redirect_output(self, statement: Statement) -> utils.RedirectionSavedState:
28052805 kwargs ['executable' ] = shell
28062806
28072807 # For any stream that is a StdSim, we will use a pipe so we can capture its output
2808- proc = subprocess .Popen ( # type: ignore[call-overload]
2808+ proc = subprocess .Popen (
28092809 statement .pipe_to ,
28102810 stdin = subproc_stdin ,
28112811 stdout = subprocess .PIPE if isinstance (self .stdout , utils .StdSim ) else self .stdout , # type: ignore[unreachable]
2812- stderr = subprocess .PIPE if isinstance (sys .stderr , utils .StdSim ) else sys .stderr , # type: ignore[unreachable]
2812+ stderr = subprocess .PIPE if isinstance (sys .stderr , utils .StdSim ) else sys .stderr ,
28132813 shell = True ,
28142814 ** kwargs ,
28152815 )
@@ -2829,7 +2829,7 @@ def _redirect_output(self, statement: Statement) -> utils.RedirectionSavedState:
28292829 new_stdout .close ()
28302830 raise RedirectionError (f'Pipe process exited with code { proc .returncode } before command could run' )
28312831 else :
2832- redir_saved_state .redirecting = True # type: ignore[unreachable]
2832+ redir_saved_state .redirecting = True
28332833 cmd_pipe_proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr )
28342834 sys .stdout = self .stdout = new_stdout
28352835
@@ -3068,7 +3068,7 @@ def complete_none(text: str, state: int) -> Optional[str]: # pragma: no cover
30683068 parser .add_argument (
30693069 'arg' ,
30703070 suppress_tab_hint = True ,
3071- choices = choices , # type: ignore[arg-type]
3071+ choices = choices ,
30723072 choices_provider = choices_provider ,
30733073 completer = completer ,
30743074 )
@@ -3846,7 +3846,7 @@ def complete_set_value(
38463846 arg_name ,
38473847 metavar = arg_name ,
38483848 help = settable .description ,
3849- choices = settable .choices , # type: ignore[arg-type]
3849+ choices = settable .choices ,
38503850 choices_provider = settable .choices_provider ,
38513851 completer = settable .completer ,
38523852 )
@@ -4001,15 +4001,15 @@ def do_shell(self, args: argparse.Namespace) -> None:
40014001 # still receive the SIGINT since it is in the same process group as us.
40024002 with self .sigint_protection :
40034003 # For any stream that is a StdSim, we will use a pipe so we can capture its output
4004- proc = subprocess .Popen ( # type: ignore[call-overload]
4004+ proc = subprocess .Popen (
40054005 expanded_command ,
40064006 stdout = subprocess .PIPE if isinstance (self .stdout , utils .StdSim ) else self .stdout , # type: ignore[unreachable]
4007- stderr = subprocess .PIPE if isinstance (sys .stderr , utils .StdSim ) else sys .stderr , # type: ignore[unreachable]
4007+ stderr = subprocess .PIPE if isinstance (sys .stderr , utils .StdSim ) else sys .stderr ,
40084008 shell = True ,
40094009 ** kwargs ,
40104010 )
40114011
4012- proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr ) # type: ignore[arg-type]
4012+ proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr )
40134013 proc_reader .wait ()
40144014
40154015 # Save the return code of the application for use in a pyscript
@@ -4101,10 +4101,10 @@ def _set_up_py_shell_env(self, interp: InteractiveConsole) -> _SavedCmd2Env:
41014101 self ._reset_py_display ()
41024102
41034103 cmd2_env .sys_stdout = sys .stdout
4104- sys .stdout = self .stdout # type: ignore[assignment]
4104+ sys .stdout = self .stdout
41054105
41064106 cmd2_env .sys_stdin = sys .stdin
4107- sys .stdin = self .stdin # type: ignore[assignment]
4107+ sys .stdin = self .stdin
41084108
41094109 return cmd2_env
41104110
@@ -4114,8 +4114,8 @@ def _restore_cmd2_env(self, cmd2_env: _SavedCmd2Env) -> None:
41144114
41154115 :param cmd2_env: the environment settings to restore
41164116 """
4117- sys .stdout = cmd2_env .sys_stdout # type: ignore[assignment]
4118- sys .stdin = cmd2_env .sys_stdin # type: ignore[assignment]
4117+ sys .stdout = cmd2_env .sys_stdout
4118+ sys .stdin = cmd2_env .sys_stdin
41194119
41204120 # Set up readline for cmd2
41214121 if rl_type != RlType .NONE :
0 commit comments