diff --git a/devscripts/prepare_manpage.py b/devscripts/prepare_manpage.py index b4446a3688..069d99eeb4 100644 --- a/devscripts/prepare_manpage.py +++ b/devscripts/prepare_manpage.py @@ -53,7 +53,8 @@ def filter_excluded_sections(readme): def move_sections(readme): MOVE_TAG_TEMPLATE = '' - 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: move_tag = MOVE_TAG_TEMPLATE % section_name