diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-10-14 14:11:49 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-10-14 15:17:27 +0100 |
commit | 443be7d15b5ce24a8f03e943b52e8aa162301b6b (patch) | |
tree | 878f749bde6bdc54e1c0eaa8dd8600a0ddcd3eb5 | |
parent | 79f2f8dec70d9df7a54f75d5688c761d84352db6 (diff) |
Escape: Add missing r in regexp literals ('...' => r'...') [7]
Detected by flake8, eg
./gbp/deb/git.py:35:6: W605 invalid escape sequence '\)'
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | gbp/rpm/__init__.py | 6 | ||||
-rw-r--r-- | gbp/scripts/common/pq.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py index b37dfda..0048af4 100644 --- a/gbp/rpm/__init__.py +++ b/gbp/rpm/__init__.py @@ -115,11 +115,11 @@ class SrcRpmFile(object): class SpecFile(object): """Class for parsing/modifying spec files""" tag_re = re.compile(r'^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*:\s*' - '(?P<value>\S(.*\S)?)\s*$', flags=re.I) + r'(?P<value>\S(.*\S)?)\s*$', flags=re.I) directive_re = re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?' - '(\s+(?P<args>.*))?$', flags=re.I) + r'(\s+(?P<args>.*))?$', flags=re.I) gbptag_re = re.compile(r'^\s*#\s*gbp-(?P<name>[a-z-]+)' - '(\s*:\s*(?P<args>\S.*))?$', flags=re.I) + r'(\s*:\s*(?P<args>\S.*))?$', flags=re.I) # Here "sections" stand for all scripts, scriptlets and other directives, # but not macros section_identifiers = ('package', 'description', 'prep', 'build', 'install', diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index b6033a2..73d419c 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -152,7 +152,7 @@ def write_patch_file(filename, commit_info, diff): name = commit_info['author']['name'] email = commit_info['author']['email'] # Git compat: put name in quotes if special characters found - if re.search("[,.@()\[\]\\\:;]", name): + if re.search(r"[,.@()\[\]\\\:;]", name): name = '"%s"' % name from_header = Header(header_name='from') try: @@ -216,7 +216,7 @@ def format_patch(outdir, repo, commit_info, series, abbrev, numbered=True, if renumber: # Remove any existing numeric prefix if the patch # should be renumbered - name = re.sub('^\d+[-_]*', '', name) + name = re.sub(r'^\d+[-_]*', '', name) else: # Otherwise, clear proposed prefix num_prefix = '' |