mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Use os.renames() in remove() to auto-create subdirectories.
Bug: 1415507 Change-Id: Ie52123dc0844639116b55bc7f6a2734aaf7df33e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4378417 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Auto-Submit: Joanna Wang <jojwang@chromium.org>
This commit is contained in:
@@ -366,8 +366,8 @@ def remove(target, cleanup_dir):
|
|||||||
allfiles = os.listdir(target)
|
allfiles = os.listdir(target)
|
||||||
for f in allfiles:
|
for f in allfiles:
|
||||||
target_path = os.path.join(target, f)
|
target_path = os.path.join(target, f)
|
||||||
dst_path = os.path.join(destination, f)
|
dst_path = os.path.join(dest, f)
|
||||||
os.rename(target_path, dst_path)
|
os.renames(target_path, dst_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Error renaming %s to %s: %s' % (target, dest, str(e)))
|
print('Error renaming %s to %s: %s' % (target, dest, str(e)))
|
||||||
raise
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user