@@ -57,11 +57,11 @@ def make_am(msgs: List[email.message.Message], cmdargs: argparse.Namespace, msgi
reroll = False
lser = lmbx.get_series(revision=wantver, sloppytrailers=cmdargs.sloppytrailers, reroll=reroll)
- if lser is None and wantver is None:
- logger.critical('No patches found.')
- return
if lser is None:
- logger.critical('Unable to find revision %s', wantver)
+ if wantver is None:
+ logger.critical('No patches found.')
+ else:
+ logger.critical('Unable to find revision %s', wantver)
return
if len(lmbx.series) > 1 and not wantver:
logger.info('Will use the latest revision: v%s', lser.revision)
In mbox.py::make_am, we check if the 'lser' LoreSeries returned by lmbx.get_series is empty, and return early with a different critical message depending on wether wantver was given or not. Simplify the logic a bit by using a nested if instead of two subsequent ones. This will make the following commit's diff simpler. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> --- b4/mbox.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)