Replace hard-coded '\\' with os.path.sep

Currently, the Windows-specific path separated is hard-coded in many locations.

This CL replaces several of them with os.path.sep to be less fragile.

Change-Id: Ib8ffca5743254949808a6b67e4915f8f01e044e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3470977
Auto-Submit: Chris Blume <cblume@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/77/3470977/4
Chris Blume 3 years ago committed by LUCI CQ
parent f72b1bafb7
commit d6d7a05085

@ -78,9 +78,9 @@ def ExpandWildcards(root, sub_dir):
def BuildRepackageFileList(src_dir):
# Strip off a trailing slash if present
if src_dir.endswith('\\'):
src_dir = src_dir[:-1]
# Strip off a trailing separator if present
if src_dir.endswith(os.path.sep):
src_dir = src_dir[:-len(os.path.sep)]
# Ensure .\Windows Kits\10\Debuggers exists and fail to repackage if it
# doesn't.
@ -311,8 +311,8 @@ def GenerateSetEnvCmd(target_dir):
])
# x86. Always use amd64_x86 cross, not x86 on x86.
env['VCToolsInstallDir'] = [vc_tools_parts[:]]
# Yuck: This one ends in a slash as well.
env['VCToolsInstallDir'][0][-1] += '\\'
# Yuck: This one ends in a path separator as well.
env['VCToolsInstallDir'][0][-1] += os.path.sep
env_x86 = collections.OrderedDict([
(
'PATH',

Loading…
Cancel
Save