Use raw string for regex patterns in python scripts

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3229
This commit is contained in:
Raymond Hill 2024-05-05 11:47:31 -04:00
parent 4d8ee35ef7
commit 923452b788
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ with open(manifest_out_file) as f:
manifest_out['version'] = version manifest_out['version'] = version
# Development build? If so, modify name accordingly. # Development build? If so, modify name accordingly.
match = re.search('^\d+\.\d+\.\d+\.\d+$', version) match = re.search(r'^\d+\.\d+\.\d+\.\d+$', version)
if match: if match:
manifest_out['name'] += ' development build' manifest_out['name'] += ' development build'
manifest_out['short_name'] += ' dev build' manifest_out['short_name'] += ' dev build'

View file

@ -21,7 +21,7 @@ with open(firefox_manifest_file) as f2:
firefox_manifest = json.load(f2) firefox_manifest = json.load(f2)
if 'sidebar_action' in firefox_manifest: if 'sidebar_action' in firefox_manifest:
match = re.search('^(\d+\.\d+\.\d+)(\.\d+)$', version) match = re.search(r'^(\d+\.\d+\.\d+)(\.\d+)$', version)
if not match: if not match:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1459007 # https://bugzilla.mozilla.org/show_bug.cgi?id=1459007
# By design Firefox opens the sidebar with new installation of # By design Firefox opens the sidebar with new installation of