Commit 07d6e698 authored by Joanna Wang's avatar Joanna Wang Committed by LUCI CQ

Use shutil when moving gsutil.

Bug:b/242209562
Change-Id: Icdb145c15fe6f4fc2a61fe3342e0dd495b972b14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3879825
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
parent e3d0dd30
......@@ -127,11 +127,7 @@ def ensure_gsutil(version, target, clean):
with zipfile.ZipFile(target_zip_filename, 'r') as target_zip:
target_zip.extractall(download_dir)
try:
os.rename(download_dir, bin_dir)
except (OSError, IOError):
# Something else did this in parallel.
pass
shutil.move(download_dir, bin_dir)
# Final check that the gsutil bin exists. This should never fail.
if not os.path.isfile(gsutil_bin):
raise InvalidGsutilError()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment