8000 Fix lib_update to support backslash by youknowone · Pull Request #6719 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/lib_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,14 @@ def build_argparse() -> argparse.ArgumentParser:

# Quick upgrade: auto-fill --from, --to, -o from path
if args.quick_upgrade is not None:
path_str = str(args.quick_upgrade)
# Normalize path separators to forward slashes for cross-platform support
path_str = str(args.quick_upgrade).replace("\\", "/")
lib_marker = "/Lib/"

if lib_marker not in path_str:
parser.error(f"--quick-upgrade path must contain '/Lib/' (got: {path_str})")
parser.error(
f"--quick-upgrade path must contain '/Lib/' or '\\Lib\\' (got: {args.quick_upgrade})"
)

idx = path_str.index(lib_marker)
lib_path = pathlib.Path(path_str[idx + 1 :])
Expand Down
Loading
0