8000 Use `gh-issue` when both `bpo` and `gh-issue` exist. · python/core-workflow@ca5e522 · GitHub
[go: up one dir, main page]

Skip to content

Commit ca5e522

Browse files
committed
Use gh-issue when both bpo and gh-issue exist.
1 parent 46b0f2c commit ca5e522

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

blurb/blurb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,11 @@ def _extract_next_filename(self):
612612
metadata, body = self[-1]
613613
metadata['section'] = sanitize_section(metadata['section'])
614614
metadata['root'] = root
615-
if int(metadata["bpo"]) > 0 :
616-
path = "{root}/Misc/NEWS.d/next/{section}/{date}.bpo-{bpo}.{nonce}.rst".format_map(metadata)
617-
else:
618-
# assume it's a GH issue number
615+
if int(metadata["gh-issue"]) > 0 :
619616
path = "{root}/Misc/NEWS.d/next/{section}/{date}.gh-issue-{gh-issue}.{nonce}.rst".format_map(metadata)
617+
elif int(metadata["bpo"]) > 0:
618+
# assume it's a GH issue number
619+
path = "{root}/Misc/NEWS.d/next/{section}/{date}.bpo-{bpo}.{nonce}.rst".format_map(metadata)
620620
for name in "root section date gh-issue bpo nonce".split():
621621
del metadata[name]
622622
return path
@@ -1114,7 +1114,7 @@ def print(*a, sep=" "):
11141114
issue_number = metadata['gh-issue']
11151115
if int(issue_number):
11161116
body = "gh-issue-" + issue_number + ": " + body
1117-
if metadata.get("bpo"):
1117+
elif metadata.get("bpo"):
11181118
issue_number = metadata['bpo']
11191119
if int(issue_number):
11201120
body = "bpo-" + issue_number + ": " + body

0 commit comments

Comments
 (0)
0