Skip to content
Snippets Groups Projects
Commit 37ae75f2 authored by Daniel Kutik's avatar Daniel Kutik
Browse files

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: default avatarDaniel Kutik <daniel.kutik@lavawerk.com>
Reviewed-by: default avatarMike Frysinger <vapier@google.com>
parent 7438aef1
Branches
No related tags found
No related merge requests found
...@@ -109,10 +109,10 @@ def replace_regex(data): ...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment