mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
fix lib_update backslash support (#6719)
This commit is contained in:
1 parent
7e47212886
commit
4d7a289971
1 file changed
+5
-2
@@ -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