diff options
author | Alexander Færøy <ahf@torproject.org> | 2023-12-11 20:18:32 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2023-12-11 20:18:32 +0000 |
commit | 0cccc7223c52512b5e0f47819f1a02740e5dad9b (patch) | |
tree | b6c1d4efada1f925fb5e30b4e0b62a6edd59b3d2 /scripts/maint/lintChanges.py | |
parent | 82e73df8f7db9e8c33dd9b1d65cc6b235656f893 (diff) | |
parent | 9f731ac68cd0409c321860a4d484bfd4c3e3f851 (diff) | |
download | tor-0cccc7223c52512b5e0f47819f1a02740e5dad9b.tar.gz tor-0cccc7223c52512b5e0f47819f1a02740e5dad9b.zip |
Merge branch 'fix-python-escs' into 'main'
Use raw strings for regexs containing escapes
See merge request tpo/core/tor!790
Diffstat (limited to 'scripts/maint/lintChanges.py')
-rwxr-xr-x | scripts/maint/lintChanges.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py index cf7b09fcc3..964feaed0a 100755 --- a/scripts/maint/lintChanges.py +++ b/scripts/maint/lintChanges.py @@ -51,7 +51,7 @@ def split_tor_version(version): If the version is malformed, returns None. ''' - version_match = re.match('([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?', version) + version_match = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?', version) if version_match is None: return None @@ -120,13 +120,13 @@ def lintfile(fname): if re.search(r'[bB]ug (\d+)', contents): if not re.search(r'[Bb]ugfix on ', contents): warn("Bugfix does not say 'bugfix on X.Y.Z'") - elif not re.search('[fF]ixes ([a-z ]*)bugs? (\d+)((, \d+)* and \d+)?; bugfix on ', + elif not re.search(r'[fF]ixes ([a-z ]*)bugs? (\d+)((, \d+)* and \d+)?; bugfix on ', contents): warn("Bugfix does not say 'Fixes bug X; bugfix on Y'") elif re.search('tor-([0-9]+)', contents): warn("Do not prefix versions with 'tor-'. ('0.1.2', not 'tor-0.1.2'.)") else: - bugfix_match = re.search('bugfix on ([0-9]+\.[0-9]+\.[0-9]+)', contents) + bugfix_match = re.search(r'bugfix on ([0-9]+\.[0-9]+\.[0-9]+)', contents) if bugfix_match is None: warn("Versions must have at least 3 digits. ('0.1.2', '0.3.4.8', or '0.3.5.1-alpha'.)") elif bugfix_match.group(0) is None: |