summaryrefslogtreecommitdiff
path: root/tools/finalize.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/finalize.py')
-rw-r--r--tools/finalize.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/finalize.py b/tools/finalize.py
index 35294281..516a2fb5 100644
--- a/tools/finalize.py
+++ b/tools/finalize.py
@@ -46,6 +46,18 @@ def update_changelog():
'--yes',
]
subprocess.check_call(cmd)
+ _repair_changelog()
+
+
+def _repair_changelog():
+ """
+ Workaround for #2666
+ """
+ changelog_fn = pathlib.Path('CHANGES.rst')
+ changelog = changelog_fn.read_text()
+ fixed = re.sub(r'^(v[0-9.]+)v[0-9.]+$', r'\1', changelog, flags=re.M)
+ changelog_fn.write_text(fixed)
+ subprocess.check_output(['git', 'add', changelog_fn])
def bump_version():