diff mbox series

[1/2] Make upper non-optional in parse_int_range()

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

Commit Message

Lucas De Marchi May 2, 2024, 7:12 p.m. UTC
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(-)

Comments

Konstantin Ryabitsev May 23, 2024, 8:33 p.m. UTC | #1
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 mbox series

Patch

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(','):