mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
tools: Use raw strings for regexps in python scripts (fixes #3677)
Starting with Python 3.12, use of invalid escape sequences in strings is reported as a SyntaxWarning and will become a SyntaxError at a later point. Regular expressions use the backslash character a lot, which result in warnings of this kind. Python docs recommend to generally use raw strings for this purpose.
This commit is contained in:
committed by
Marshall Greenblatt
parent
fb6b4df1ef
commit
b15e34cfa1
@ -34,10 +34,10 @@ def MakeFileSegment(input, all_names):
|
||||
# #define IDR_RESOURCE_NAME 12345
|
||||
# [1] See https://crbug.com/684788#c18
|
||||
|
||||
regex = '#define\s([A-Za-z0-9_]{1,})\s+'
|
||||
regex = r'#define\s([A-Za-z0-9_]{1,})\s+'
|
||||
if contents.find('ui::WhitelistedResource') > 0:
|
||||
regex += '.*<'
|
||||
regex += '([0-9]{1,})'
|
||||
regex += r'.*<'
|
||||
regex += r'([0-9]{1,})'
|
||||
|
||||
# identify the defines in the file
|
||||
p = re.compile(regex)
|
||||
|
Reference in New Issue
Block a user