Fix a SyntaxWarning using raw strings

137: SyntaxWarning: invalid escape sequence '\d'.

Bug: 40283283
Change-Id: I09864101f572ecc1a0c6abf2d6cf2653129d3b87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7058230
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Ho Cheung <hocheung@chromium.org>
This commit is contained in:
Ho Cheung
2025-10-20 16:42:53 -07:00
committed by LUCI CQ
parent 7709d4cdd7
commit 16dfe4717b

View File

@@ -134,7 +134,7 @@ def upload_to_google_storage(file: str, base_url: str, object_name: str,
raise Exception(
code, 'Encountered error on uploading %s to %s\n%s' %
(file, file_url, err))
pattern = re.escape(file_url) + '#(?P<generation>\d+)'
pattern = re.escape(file_url) + r'#(?P<generation>\d+)'
# The geneartion number is printed as part of the progress / status info
# which gsutil outputs to stderr to keep separated from any final output
# data.