Skip to content

Commit

Permalink
Update exec_python.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzhang1130 committed Sep 13, 2024
1 parent 5c7c942 commit 3331fa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/agentscope/service/execute_code/exec_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ def docker_execute(

# Construct the timer context manager code
exec_code_with_timer = (
"import contextlib, signal\nfrom typing import Any, Generator, Optional, Union\n"
"import contextlib, signal\n"
"from typing import Any, Generator, Optional, Union\n"
+ timer_code
+ f"\nwith timer({timeout}):\n"
)
Expand Down

0 comments on commit 3331fa4

Please sign in to comment.