1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-20 01:42:50 +01:00

[docs] Fix bug in regex escape in python 3.6

Bug in ec2e44fc57
Closes #2060
This commit is contained in:
pukkandan 2021-12-20 18:43:33 +05:30
parent adbc4ec4bb
commit 0fcba15d57
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -53,7 +53,8 @@ def filter_excluded_sections(readme):
def move_sections(readme): def move_sections(readme):
MOVE_TAG_TEMPLATE = '<!-- MANPAGE: MOVE "%s" SECTION HERE -->' MOVE_TAG_TEMPLATE = '<!-- MANPAGE: MOVE "%s" SECTION HERE -->'
sections = re.findall(rf'(?m)^{re.escape(MOVE_TAG_TEMPLATE) % "(.+)"}$', readme) sections = re.findall(r'(?m)^%s$' % (
re.escape(MOVE_TAG_TEMPLATE).replace(r'\%', '%') % '(.+)'), readme)
for section_name in sections: for section_name in sections:
move_tag = MOVE_TAG_TEMPLATE % section_name move_tag = MOVE_TAG_TEMPLATE % section_name