Jelajahi Sumber

[gclient] Fix SyntaxWarning when running py3.13

R=gavinmak@google.com

Bug: 40283283
Change-Id: I1a4a53f9d50eaa8601113485a07297c0863f7466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6442907
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Josip Sokcevic 4 bulan lalu
induk
melakukan
08fdf45d82
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 1
      gclient.py
  2. 1 1
      gclient_scm.py

+ 1 - 1
gclient.py

@@ -3364,7 +3364,7 @@ def CMDgitmodules(parser, args):
     # first time.
     # first time.
     set_recursedeps = True
     set_recursedeps = True
     if os.path.exists(options.output_gitmodules):
     if os.path.exists(options.output_gitmodules):
-        dot_git_pattern = re.compile('^(\s*)url(\s*)=.*\.git$')
+        dot_git_pattern = re.compile(r'^(\s*)url(\s*)=.*\.git$')
         with open(options.output_gitmodules) as f:
         with open(options.output_gitmodules) as f:
             strip_git_suffix = not any(dot_git_pattern.match(l) for l in f)
             strip_git_suffix = not any(dot_git_pattern.match(l) for l in f)
             set_recursedeps = any(
             set_recursedeps = any(

+ 1 - 1
gclient_scm.py

@@ -433,7 +433,7 @@ class GitWrapper(SCMWrapper):
         patch_rev_tokens = patch_rev.split('/')
         patch_rev_tokens = patch_rev.split('/')
         change = patch_rev_tokens[-2]
         change = patch_rev_tokens[-2]
         # Parse the googlesource_url.
         # Parse the googlesource_url.
-        tokens = re.search('//(.+).googlesource.com/(.+?)(?:\.git)?$',
+        tokens = re.search(r'//(.+).googlesource.com/(.+?)(?:\.git)?$',
                            googlesource_url)
                            googlesource_url)
         if not tokens or len(tokens.groups()) != 2:
         if not tokens or len(tokens.groups()) != 2:
             # googlesource_url is not in the expected format.
             # googlesource_url is not in the expected format.