mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
fix lib_update backslash support (#6719)
This commit is contained in:
@@ -340,11 +340,14 @@ if __name__ == "__main__":
|
||||
|
||||
# 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 :])
|
||||
|
||||
Reference in New Issue
Block a user