From d05be9be17c053240dc11860b4419dbdd096be38 Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Wed, 18 Sep 2019 20:02:34 -0700 Subject: [PATCH] update make_fbpy_archive.py to replace the output on Windows Summary: Update the code to use `os.replace()` rather than `os.rename()` so that it won't fail on Windows if the destination path already exists. Reviewed By: chadaustin Differential Revision: D17462716 fbshipit-source-id: cbc06319ccb2d73868f80ab1874890ebec5a621b --- build/fbcode_builder/CMake/make_fbpy_archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/fbcode_builder/CMake/make_fbpy_archive.py b/build/fbcode_builder/CMake/make_fbpy_archive.py index 3229110ee..4e91447af 100755 --- a/build/fbcode_builder/CMake/make_fbpy_archive.py +++ b/build/fbcode_builder/CMake/make_fbpy_archive.py @@ -140,7 +140,7 @@ def build_zipapp(args, path_map): zipapp.create_archive( inst_dir, target=tmp_output, interpreter=args.python, main=args.main ) - os.rename(tmp_output, args.output) + os.replace(tmp_output, args.output) def create_main_module(args, inst_dir, path_map):