diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -246,9 +246,10 @@ ) ) else: - if not procutil.findexe(method): + command = procutil.shellsplit(method) + if not (command and procutil.findexe(command[0])): raise error.Abort( - _(b'%r specified as email transport, but not in PATH') % method + _(b'%r specified as email transport, but not in PATH') % command[0] )