mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
update_manpages.py: treat regex as raw string
Treat the values in the regex map as raw strings to fix Invalid escape sequence 'g' (W605). Change-Id: I53bf5d6bd1e1d6a1d1293e4f55640b6513bf3075 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354698 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
7438aef1ca
commit
37ae75f27d
@ -109,10 +109,10 @@ def replace_regex(data):
|
|||||||
Updated manpage text.
|
Updated manpage text.
|
||||||
"""
|
"""
|
||||||
regex = (
|
regex = (
|
||||||
(r'(It was generated by help2man) [0-9.]+', '\g<1>.'),
|
(r'(It was generated by help2man) [0-9.]+', r'\g<1>.'),
|
||||||
(r'^\033\[[0-9;]*m([^\033]*)\033\[m', '\g<1>'),
|
(r'^\033\[[0-9;]*m([^\033]*)\033\[m', r'\g<1>'),
|
||||||
(r'^\.IP\n(.*:)\n', '.SS \g<1>\n'),
|
(r'^\.IP\n(.*:)\n', r'.SS \g<1>\n'),
|
||||||
(r'^\.PP\nDescription', '.SH DETAILS'),
|
(r'^\.PP\nDescription', r'.SH DETAILS'),
|
||||||
)
|
)
|
||||||
for pattern, replacement in regex:
|
for pattern, replacement in regex:
|
||||||
data = re.sub(pattern, replacement, data, flags=re.M)
|
data = re.sub(pattern, replacement, data, flags=re.M)
|
||||||
|
Loading…
Reference in New Issue
Block a user