Message ID | 20240502191205.3964106-1-lucas.demarchi@intel.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] Make upper non-optional in parse_int_range() | expand |
On Thu, 02 May 2024 12:12:04 -0700, Lucas De Marchi wrote: > All calls to parse_int_range() already pass the maximum value. This will > be required if ranges are accepted to be negative, so prepare for that. > > Applied, thanks! [1/2] Make upper non-optional in parse_int_range() commit: e678e4db27e424bcd69c76e14f633df7f6026ddc [2/2] Allow negative number in parse_int_range() commit: 18e6921e8befd8c2cde9ae989a7197fe5bcd1558 Best regards,
diff --git a/src/b4/__init__.py b/src/b4/__init__.py index aa65c43..b3f1c90 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -3541,7 +3541,7 @@ def make_quote(body: str, maxlines: int = 5) -> str: return '\n'.join(quotelines) -def parse_int_range(intrange: str, upper: Optional[int] = None) -> Iterator[int]: +def parse_int_range(intrange: str, upper: int) -> Iterator[int]: # Remove all whitespace intrange = re.sub(r'\s', '', intrange) for n in intrange.split(','):
All calls to parse_int_range() already pass the maximum value. This will be required if ranges are accepted to be negative, so prepare for that. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> --- src/b4/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)