aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-05-22 22:58:12 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-25 07:54:56 -0400
commit5d6e3d8e47af6c787ca2cc32e873478fb5c3ba55 (patch)
tree805c677e6b5c978fd2c13bcbb31e68bea94f8f16
parent7ed8a3cafd5f3ba5b4e914b495bb3035428e2d45 (diff)
downloadb4-5d6e3d8e47af6c787ca2cc32e873478fb5c3ba55.tar.gz
Avoid type error when local mbox lacks specified message ID
Calling b4-am with --use-local=MBOX is supposed to abort with "Could not find MID in MBOX" if the mbox doesn't contain the specified message ID. As of 4950093c0 (Don't use mboxo for anything, 2021-05-18), a type error is signaled because get_strict_thread() returns None when there are no matches, and get_msgs() feeds this result to len(). Update get_msgs() to instead check whether the returned value evaluates to false. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210523025812.26456-1-kyle@kyleam.com
-rw-r--r--b4/mbox.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index a4b005f..bf1a586 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -572,7 +572,7 @@ def get_msgs(cmdargs) -> Tuple[Optional[str], Optional[list]]:
if msgid:
msgs = b4.get_strict_thread(in_mbx, msgid)
- if not len(msgs):
+ if not msgs:
logger.critical('Could not find %s in %s', msgid, cmdargs.localmbox)
sys.exit(1)
else: