mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
Fixing the absence of pathlib.rmtree for older Python libs.
This commit is contained in:
parent
142e183f5f
commit
5fc4c2adb9
2 changed files with 4 additions and 6 deletions
|
|
@ -8,7 +8,7 @@
|
|||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="SDK_NAME" value="$USER_HOME$/miniforge3/envs/codeflash311" />
|
||||
<option name="SDK_NAME" value="$USER_HOME$/miniforge3/envs/codeflash312" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/cli" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import concurrent.futures
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
|
|
@ -193,11 +194,8 @@ class Optimizer:
|
|||
subprocess.run(["git", "worktree", "remove", "-f", worktree], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
logger.warning(f"Error deleting worktree: {e}")
|
||||
for root, dirs, files in worktree_root.walk(top_down=False):
|
||||
for name in files:
|
||||
(root / name).unlink()
|
||||
for name in dirs:
|
||||
(root / name).rmdir()
|
||||
shutil.rmtree(worktree)
|
||||
shutil.rmtree(worktree_root)
|
||||
|
||||
if is_successful(best_optimization):
|
||||
optimizations_found += 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue