From: Lucas De Marchi <lucas.demarchi@intel.com>
To: tools@kernel.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH 1/2] Make upper non-optional in parse_int_range()
Date: Thu, 2 May 2024 12:12:04 -0700 [thread overview]
Message-ID: <20240502191205.3964106-1-lucas.demarchi@intel.com> (raw)
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(-)
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(','):
--
2.43.0
next reply other threads:[~2024-05-02 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 19:12 Lucas De Marchi [this message]
2024-05-02 19:12 ` [PATCH 2/2] Allow negative number in parse_int_range() Lucas De Marchi
2024-05-23 20:33 ` [PATCH 1/2] Make upper non-optional " Konstantin Ryabitsev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240502191205.3964106-1-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=tools@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).