8000 Distinqush if gh-issue is number or < 32426 errors · python/core-workflow@f864c05 · GitHub
[go: up one dir, main page]

Skip to content

Commit f864c05

Browse files
committed
Distinqush if gh-issue is number or < 32426 errors
1 parent 7b2b46d commit f864c05

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

blurb/blurb.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -956,13 +956,14 @@ def init_tmp_with_template():
956956
failure = str(e)
957957

958958
if not failure:
959-
with open(tmp_path, "rt", encoding="utf-8") as file:
960-
for line in file:
961-
if line.startswith(".. gh-issue:"):
962-
issue_number = line.split(":")[1].strip()
963-
if issue_number.isdigit() and int(issue_number) < 32426:
964-
failure = "The gh-issue number should be 32426 or above."
965-
break
959+
assert len(blurb) # if parse_blurb succeeds, we should always have a body
960+
if len(blurb) > 1:
961+
failure = "Too many entries! Don't specify '..' on a line by itself."
962+
gh_issue_number = blurb[0][0]["gh-issue"]
963+
if not gh_issue_number.isdigit():
964+
failure = "The gh-issue number must be a number."
965+
if int(gh_issue_number) < 32426:
966+
failure = "The gh-issue number should be 32426 or above."
966967

967968
if failure:
968969
print()

0 commit comments

Comments
 (0)
0