Skip to content

Commit 199bc1d

Browse files
committed
Fix create_release.py script to handle bad underlines
The script was assuming the underline was the same length as the title itself. e.g. it did not handle. ``` 1.3.4 (in development) ------------------- ``` See #24516
1 parent 43822b0 commit 199bc1d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/maint/create_release.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ def update_changelog(release_version, new_version):
2727
changelog = utils.read_file(changelog_file)
2828
marker = f'{release_version} (in development)'
2929
pos = changelog.find(marker)
30-
assert pos != -1
31-
pos += 2 * len(marker) + 1
30+
assert pos >= 0
31+
pos += len(marker) + 1
32+
# Skip the next line which should just be hypens
33+
assert changelog[pos] == '-'
34+
pos = changelog.find('\n', pos)
35+
assert pos >= 0
3236

3337
# Add new entry
3438
today = datetime.now().strftime('%m/%d/%y')

0 commit comments

Comments
 (0)