@@ -115,7 +115,7 @@ def __call__(self, command: str, *, echo: Optional[bool] = None) -> CommandResul
115115 echo = self .cmd_echo
116116
117117 # This will be used to capture _cmd2_app.stdout and sys.stdout
118- copy_cmd_stdout = StdSim (cast (' Union[TextIO, StdSim]' , self ._cmd2_app .stdout ), echo = echo )
118+ copy_cmd_stdout = StdSim (cast (Union [TextIO , StdSim ], self ._cmd2_app .stdout ), echo = echo )
119119
120120 # Pause the storing of stdout until onecmd_plus_hooks enables it
121121 copy_cmd_stdout .pause_storage = True
@@ -127,17 +127,17 @@ def __call__(self, command: str, *, echo: Optional[bool] = None) -> CommandResul
127127
128128 stop = False
129129 try :
130- self ._cmd2_app .stdout = cast (' TextIO' , copy_cmd_stdout )
131- with redirect_stdout (cast (' IO[str]' , copy_cmd_stdout )):
132- with redirect_stderr (cast (' IO[str]' , copy_stderr )):
130+ self ._cmd2_app .stdout = cast (TextIO , copy_cmd_stdout )
131+ with redirect_stdout (cast (IO [str ], copy_cmd_stdout )):
132+ with redirect_stderr (cast (IO [str ], copy_stderr )):
133133 stop = self ._cmd2_app .onecmd_plus_hooks (
134134 command ,
135135 add_to_history = self ._add_to_history ,
136136 py_bridge_call = True ,
137137 )
138138 finally :
139139 with self ._cmd2_app .sigint_protection :
140- self ._cmd2_app .stdout = cast (' IO[str]' , copy_cmd_stdout .inner_stream )
140+ self ._cmd2_app .stdout = cast (IO [str ], copy_cmd_stdout .inner_stream )
141141 self .stop = stop or self .stop
142142
143143 # Save the result
0 commit comments