mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-08 21:26:04 +00:00
Fix Python 3.13 re DeprecationWarning: pass count and flags by keyword
https://docs.python.org/3/library/re.html: > Deprecated since version 3.13: Passing count and flags as positional > arguments is deprecated. In future Python versions they will be > keyword-only parameters. https://github.com/python/cpython/issues/56166, https://github.com/python/cpython/pull/107778, https://docs.python.org/3/whatsnew/3.13.html#:~:text=gh%2D66543.)-,re%3A,-Deprecate%20passing%20the Change-Id: Ibda1394927062dd9e0353e2b9d643b510070deb6 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6298792 Reviewed-by: Leonard Grey <lgrey@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
4d14c1be03
commit
51eba29eee
@ -89,8 +89,9 @@ def _BinaryDirTargetOS(binary_dir):
|
||||
if os.path.exists(build_ninja_path):
|
||||
with open(build_ninja_path) as build_ninja_file:
|
||||
build_ninja_content = build_ninja_file.read()
|
||||
match = re.search(r'-linux-android(eabi)?-ar$', build_ninja_content,
|
||||
re.MULTILINE)
|
||||
match = re.search(r'-linux-android(eabi)?-ar$',
|
||||
build_ninja_content,
|
||||
flags=re.MULTILINE)
|
||||
if match:
|
||||
return 'android'
|
||||
|
||||
|
@ -237,7 +237,7 @@ class CdbRun(object):
|
||||
[cdb_path, '-z', dump_path, '-c', command + ';q'], text=True)
|
||||
|
||||
def Check(self, pattern, message, re_flags=0, must_not_match=False):
|
||||
match_obj = re.search(pattern, self.out, re_flags)
|
||||
match_obj = re.search(pattern, self.out, flags=re_flags)
|
||||
if match_obj and not must_not_match:
|
||||
# Matched. Consume up to end of match.
|
||||
self.out = self.out[match_obj.end(0):]
|
||||
@ -263,7 +263,7 @@ class CdbRun(object):
|
||||
g_had_failures = True
|
||||
|
||||
def Find(self, pattern, re_flags=0):
|
||||
match_obj = re.search(pattern, self.out, re_flags)
|
||||
match_obj = re.search(pattern, self.out, flags=re_flags)
|
||||
if match_obj:
|
||||
# Matched. Consume up to end of match.
|
||||
self.out = self.out[match_obj.end(0):]
|
||||
|
@ -69,7 +69,7 @@ def _fix_user_implementation(implementation, fixed_implementation, header,
|
||||
file = open(implementation, 'r+' if fixed_implementation is None else 'r')
|
||||
contents = file.read()
|
||||
|
||||
pattern = re.compile('^(\t} __Reply);$', re.MULTILINE)
|
||||
pattern = re.compile('^(\t} __Reply);$', flags=re.MULTILINE)
|
||||
contents = pattern.sub(r'\1 __attribute__((unused));', contents)
|
||||
|
||||
if fixed_header is not None:
|
||||
@ -112,7 +112,7 @@ def _fix_server_implementation(implementation, fixed_implementation, header,
|
||||
|
||||
# Find interesting declarations.
|
||||
declaration_pattern = re.compile(
|
||||
'^mig_internal (kern_return_t __MIG_check__.*)$', re.MULTILINE)
|
||||
'^mig_internal (kern_return_t __MIG_check__.*)$', flags=re.MULTILINE)
|
||||
declarations = declaration_pattern.findall(contents)
|
||||
|
||||
# Remove “__attribute__((__unused__))” from the declarations, and call them
|
||||
|
Loading…
x
Reference in New Issue
Block a user