From ad63e3a6215f7389424287bad71ec0f811cf8ecb Mon Sep 17 00:00:00 2001 From: fabian Date: Mon, 24 Feb 2025 19:29:25 +0100 Subject: [PATCH] fix: consider edge case of empty or space only string when parsing ranges --- src/gallia/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallia/utils.py b/src/gallia/utils.py index c01903814..df093a7f5 100644 --- a/src/gallia/utils.py +++ b/src/gallia/utils.py @@ -86,6 +86,9 @@ def unravel(listing: str) -> list[int]: range_delimiter = "-" result = set() + if len(listing) == 0 or listing.isspace(): + return [] + for range_element in listing.split(listing_delimiter): if range_delimiter in range_element: first_tmp, last_tmp = range_element.split(range_delimiter)