Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sonichi committed Sep 19, 2023
1 parent 41074d1 commit eb7b26a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions autogen/code_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,14 @@ def execute_code(
return 1, TIMEOUT_MSG, None
if original_filename is None:
os.remove(filepath)
abs_path = str(pathlib.Path(filepath).absolute())
else:
abs_path = str(pathlib.Path(work_dir).absolute()) + "/"
if result.returncode:
logs = result.stderr
print(str(abs_path), logs)
logs = logs.replace(str(abs_path), "")
if original_filename is None:
abs_path = str(pathlib.Path(filepath).absolute())
logs = logs.replace(str(abs_path), "").replace(filepath, "")
else:
abs_path = str(pathlib.Path(work_dir).absolute()) + "/"
logs = logs.replace(str(abs_path), "")
else:
logs = result.stdout
return result.returncode, logs, None
Expand Down

0 comments on commit eb7b26a

Please sign in to comment.