mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user