D7542: mail: don't complain about a multi-word email.method

Yuya Nishihara yuya at tcha.org
Tue Dec 3 07:54:36 EST 2019


> +        command = procutil.shellsplit(method)
> +        if not (command and procutil.findexe(command[0])):

This condition is correct, but `command[0]` would raise IndexError if
`not command`.

Maybe we'll need a helper function that does `shellsplit()` and returns
`command[0]` or `b''`.

> -                _(b'%r specified as email transport, but not in PATH') % method
> +                _(b'%r specified as email transport, but not in PATH') % command[0]


More information about the Mercurial-devel mailing list