@@ -115,7 +115,7 @@ def __call__(self, command: str, *, echo: Optional[bool] = None) -> CommandResul
115
115
echo = self .cmd_echo
116
116
117
117
# 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 )
119
119
120
120
# Pause the storing of stdout until onecmd_plus_hooks enables it
121
121
copy_cmd_stdout .pause_storage = True
@@ -127,17 +127,17 @@ def __call__(self, command: str, *, echo: Optional[bool] = None) -> CommandResul
127
127
128
128
stop = False
129
129
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 )):
133
133
stop = self ._cmd2_app .onecmd_plus_hooks (
134
134
command ,
135
135
add_to_history = self ._add_to_history ,
136
136
py_bridge_call = True ,
137
137
)
138
138
finally :
139
139
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 )
141
141
self .stop = stop or self .stop
142
142
143
143
# Save the result
0 commit comments