Replace remaining Path.join() calls

Use Path.joinpath() or the / operator instead of Path.join().
Eventually, config_types.Path will be replaced with pathlib.Path, which
doesn't have a join() method. In general, if the substitution was simple
the / operator was used. Otherwise, '.join(' was replaced with
'.joinpath('.

Change-Id: Iff2eb0abd9fdb0d3b3bca281c7c5436f932a5380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5483206
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This commit is contained in:
Rob Mohr
2024-04-25 22:43:01 +00:00
committed by LUCI CQ
parent 8d3ab2eeb6
commit 4246ba023a
3 changed files with 4 additions and 4 deletions

View File

@@ -489,7 +489,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
and 'root' in result):
co_root = result['root']
cwd = self.m.context.cwd or self.m.path.start_dir
self.m.path.checkout_dir = cwd.join(co_root)
self.m.path.checkout_dir = cwd / co_root
return step_result

View File

@@ -273,7 +273,7 @@ class GclientApi(recipe_api.RecipeApi):
finally:
cwd = self.m.context.cwd or self.m.path.start_dir
if 'checkout' not in self.m.path:
self.m.path.checkout_dir = cwd.join(
self.m.path.checkout_dir = cwd.joinpath(
*cfg.solutions[0].name.split(self.m.path.sep))
return sync_step

View File

@@ -75,7 +75,7 @@ class PresubmitApi(recipe_api.RecipeApi):
no_fetch_tags=True,
root_solution_revision=root_solution_revision)
abs_root = self.m.context.cwd.join(self._relative_root)
abs_root = self.m.context.cwd / self._relative_root
if self.m.tryserver.is_tryserver:
with self.m.context(cwd=abs_root):
# TODO(unowned): Consider either:
@@ -110,7 +110,7 @@ class PresubmitApi(recipe_api.RecipeApi):
Returns:
a RawResult object, suitable for being returned from RunSteps.
"""
abs_root = self.m.context.cwd.join(self._relative_root)
abs_root = self.m.context.cwd / self._relative_root
got_revision_properties = self.m.bot_update.get_project_revision_properties(
# Replace path.sep with '/', since most recipes are written assuming '/'
# as the delimiter. This breaks on windows otherwise.