@@ -987,7 +987,7 @@ def _unregister_subcommands(self, cmdset: Union[CommandSet, 'Cmd']) -> None:
987
987
988
988
for action in command_parser ._actions :
989
989
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]
991
991
break
992
992
993
993
@property
@@ -2095,15 +2095,15 @@ def _perform_completion(
2095
2095
completer .complete , tokens = raw_tokens [1 :] if preserve_quotes else tokens [1 :], cmd_set = cmd_set
2096
2096
)
2097
2097
else :
2098
- completer_func = self .completedefault # type: ignore[assignment]
2098
+ completer_func = self .completedefault
2099
2099
2100
2100
# Not a recognized command
2101
2101
else :
2102
2102
# Check if this command should be run as a shell command
2103
2103
if self .default_to_shell and command in utils .get_exes_in_path (command ):
2104
2104
completer_func = self .path_complete
2105
2105
else :
2106
- completer_func = self .completedefault # type: ignore[assignment]
2106
+ completer_func = self .completedefault
2107
2107
2108
2108
# Otherwise we are completing the command token or performing custom completion
2109
2109
else :
@@ -2805,11 +2805,11 @@ def _redirect_output(self, statement: Statement) -> utils.RedirectionSavedState:
2805
2805
kwargs ['executable' ] = shell
2806
2806
2807
2807
# 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 (
2809
2809
statement .pipe_to ,
2810
2810
stdin = subproc_stdin ,
2811
2811
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 ,
2813
2813
shell = True ,
2814
2814
** kwargs ,
2815
2815
)
@@ -2829,7 +2829,7 @@ def _redirect_output(self, statement: Statement) -> utils.RedirectionSavedState:
2829
2829
new_stdout .close ()
2830
2830
raise RedirectionError (f'Pipe process exited with code { proc .returncode } before command could run' )
2831
2831
else :
2832
- redir_saved_state .redirecting = True # type: ignore[unreachable]
2832
+ redir_saved_state .redirecting = True
2833
2833
cmd_pipe_proc_reader = utils .ProcReader (proc , cast (TextIO , self .stdout ), sys .stderr )
2834
2834
sys .stdout = self .stdout = new_stdout
2835
2835
@@ -3068,7 +3068,7 @@ def complete_none(text: str, state: int) -> Optional[str]: # pragma: no cover
3068
3068
parser .add_argument (
3069
3069
'arg' ,
3070
3070
suppress_tab_hint = True ,
3071
- choices = choices , # type: ignore[arg-type]
3071
+ choices = choices ,
3072
3072
choices_provider = choices_provider ,
3073
3073
completer = completer ,
3074
3074
)
@@ -3846,7 +3846,7 @@ def complete_set_value(
3846
3846
arg_name ,
3847
3847
metavar = arg_name ,
3848
3848
help = settable .description ,
3849
- choices = settable .choices , # type: ignore[arg-type]
3849
+ choices = settable .choices ,
3850
3850
choices_provider = settable .choices_provider ,
3851
3851
completer = settable .completer ,
3852
3852
)
@@ -4001,15 +4001,15 @@ def do_shell(self, args: argparse.Namespace) -> None:
4001
4001
# still receive the SIGINT since it is in the same process group as us.
4002
4002
with self .sigint_protection :
4003
4003
# 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 (
4005
4005
expanded_command ,
4006
4006
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 ,
4008
4008
shell = True ,
4009
4009
** kwargs ,
4010
4010
)
4011
4011
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 )
4013
4013
proc_reader .wait ()
4014
4014
4015
4015
# 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:
4101
4101
self ._reset_py_display ()
4102
4102
4103
4103
cmd2_env .sys_stdout = sys .stdout
4104
- sys .stdout = self .stdout # type: ignore[assignment]
4104
+ sys .stdout = self .stdout
4105
4105
4106
4106
cmd2_env .sys_stdin = sys .stdin
4107
- sys .stdin = self .stdin # type: ignore[assignment]
4107
+ sys .stdin = self .stdin
4108
4108
4109
4109
return cmd2_env
4110
4110
@@ -4114,8 +4114,8 @@ def _restore_cmd2_env(self, cmd2_env: _SavedCmd2Env) -> None:
4114
4114
4115
4115
:param cmd2_env: the environment settings to restore
4116
4116
"""
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
4119
4119
4120
4120
# Set up readline for cmd2
4121
4121
if rl_type != RlType .NONE :
0 commit comments