From bd807eecd16eb308e121ff6d51210edee8635083 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Thu, 8 Dec 2022 22:05:03 +0300 Subject: [PATCH] bin/gen_release_notes.py: do not end "features" with "None" Currently, the "New features" list unconditionally ends with a "None" point, which makes no sense. The original author probably meant to check whether the file is empty, so remove the else clause, and add the check for emptiness. Cc: mesa-stable Signed-off-by: Konstantin Kharlamov Reviewed-by: Eric Engestrom Part-of: --- bin/gen_release_notes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/gen_release_notes.py b/bin/gen_release_notes.py index 2f6750fc0cf..b323fc24046 100755 --- a/bin/gen_release_notes.py +++ b/bin/gen_release_notes.py @@ -282,14 +282,12 @@ def calculate_previous_version(version: str, is_point: bool) -> str: def get_features(is_point_release: bool) -> typing.Generator[str, None, None]: p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / 'new_features.txt' - if p.exists(): + if p.exists() and p.stat().st_size > 0: if is_point_release: print("WARNING: new features being introduced in a point release", file=sys.stderr) with p.open('rt') as f: for line in f: yield line.rstrip() - else: - yield "None" p.unlink() else: yield "None"