Skip to content

Commit 627a278

Browse files
committed
fix: fixed type errors
1 parent 872eb02 commit 627a278

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gptme/tools/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def _execute_shell(cmd: str, ask=True) -> Generator[Message, None, None]:
171171
yield Message("system", msg)
172172

173173

174-
locals_ = {}
175-
globals_ = {}
174+
locals_ = {} # type: ignore
175+
globals_ = {} # type: ignore
176176

177177

178178
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]:
208208
io.StringIO()
209209
) as err:
210210
try:
211-
exec(code_compiled, globals_, locals_)
211+
exec(code_compiled, globals_, locals_) # type: ignore
212212
except Exception as e:
213213
exc = e
214214
stdout = out.getvalue().strip()
@@ -222,9 +222,9 @@ def _execute_python(code: str, ask=True) -> Generator[Message, None, None]:
222222
output += f"stderr:\n{stderr}\n\n"
223223
if exc:
224224
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
228228
yield Message("system", "Executed code block.\n\n" + output)
229229
else:
230230
yield Message("system", "Aborted, user chose not to run command.")

0 commit comments

Comments
 (0)