This commit is contained in:
Saifeddine ALOUI 2024-03-25 23:17:00 +01:00
parent 4e27e9a996
commit 72c296e533

View File

@ -2509,7 +2509,6 @@ class APScript(StateMachine):
if code_folder is not None: if code_folder is not None:
code_folder = Path(code_folder) code_folder = Path(code_folder)
def spawn_process(code):
"""Executes Python code and returns the output as JSON.""" """Executes Python code and returns the output as JSON."""
# Create a temporary file. # Create a temporary file.
root_folder = code_folder if code_folder is not None else self.personality.personality_output_folder root_folder = code_folder if code_folder is not None else self.personality.personality_output_folder
@ -2537,7 +2536,6 @@ class APScript(StateMachine):
# The child process was successful. # The child process was successful.
return output.decode("utf8") return output.decode("utf8")
return spawn_process(code)
def build_python_code(self, prompt, max_title_length=4096): def build_python_code(self, prompt, max_title_length=4096):
if not PackageManager.check_package_installed("autopep8"): if not PackageManager.check_package_installed("autopep8"):