From 10c5963d0c8c7812a534578945ba4e43dbf19174 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral <38422348+umarcor@users.noreply.github.com> Date: Tue, 21 Mar 2023 11:22:49 +0100 Subject: [PATCH] build: check if fragment_filenames is empty Co-authored-by: Chris Beaven --- src/towncrier/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/towncrier/build.py b/src/towncrier/build.py index 19c4c6a1..672d8e51 100644 --- a/src/towncrier/build.py +++ b/src/towncrier/build.py @@ -279,6 +279,9 @@ def should_remove_fragment_files( answer_yes: bool, answer_keep: bool, ) -> bool: + if not fragment_filenames: + click.echo("No news fragments to remove. Skipping...") + return False try: if answer_keep: click.echo("Keeping the following files:")