@@ -171,8 +171,8 @@ def _execute_shell(cmd: str, ask=True) -> Generator[Message, None, None]:
171
171
yield Message ("system" , msg )
172
172
173
173
174
- locals_ = {}
175
- globals_ = {}
174
+ locals_ = {} # type: ignore
175
+ globals_ = {} # type: ignore
176
176
177
177
178
178
def _execute_python (code : str , ask = True ) -> Generator [Message , None , None ]:
@@ -208,7 +208,7 @@ def _execute_python(code: str, ask=True) -> Generator[Message, None, None]:
208
208
io .StringIO ()
209
209
) as err :
210
210
try :
211
- exec (code_compiled , globals_ , locals_ )
211
+ exec (code_compiled , globals_ , locals_ ) # type: ignore
212
212
except Exception as e :
213
213
exc = e
214
214
stdout = out .getvalue ().strip ()
@@ -222,9 +222,9 @@ def _execute_python(code: str, ask=True) -> Generator[Message, None, None]:
222
222
output += f"stderr:\n { stderr } \n \n "
223
223
if exc :
224
224
tb = exc .__traceback__
225
- while tb .tb_next :
226
- tb = tb .tb_next
227
- output += f"Exception during execution on line { tb .tb_lineno } :\n { exc .__class__ .__name__ } : { exc } "
225
+ while tb .tb_next : # type: ignore
226
+ tb = tb .tb_next # type: ignore
227
+ output += f"Exception during execution on line { tb .tb_lineno } :\n { exc .__class__ .__name__ } : { exc } " # type: ignore
228
228
yield Message ("system" , "Executed code block.\n \n " + output )
229
229
else :
230
230
yield Message ("system" , "Aborted, user chose not to run command." )
0 commit comments