Skip to content

Commit d62462d

Browse files
committed
fix linting errors
1 parent f0b4657 commit d62462d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codeflash/optimization/optimizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def mirror_path(path: Path, src_root: Path, dest_root: Path) -> Path:
509509
# Try using Path.relative_to with resolved paths first
510510
try:
511511
relative_path = path_resolved.relative_to(src_root_resolved)
512-
except ValueError:
512+
except ValueError as err:
513513
# If relative_to fails, manually extract the relative path using normalized strings
514514
if path_normalized.startswith(src_root_normalized):
515515
# Extract relative path manually
@@ -522,10 +522,11 @@ def mirror_path(path: Path, src_root: Path, dest_root: Path) -> Path:
522522
relative_str = path_normalized[len(src_root_normalized) :].lstrip(os.sep)
523523
relative_path = Path(relative_str)
524524
else:
525-
raise ValueError(
525+
error_msg = (
526526
f"Path {path_resolved} (normalized: {path_normalized}) is not relative to "
527527
f"{src_root_resolved} (normalized: {src_root_normalized})"
528528
)
529+
raise ValueError(error_msg) from err
529530

530531
return dest_root / relative_path
531532

0 commit comments

Comments
 (0)