Mercurial > public > mercurial-scm > hg-stable
diff mercurial/utils/procutil.py @ 37463:bbd240f81ac5
procutil: make explainexit() simply return a message (API)
Almost all callers want it.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 07 Apr 2018 21:23:42 +0900 |
parents | c0d0fd87ba7c |
children | 632b92899203 |
line wrap: on
line diff
--- a/mercurial/utils/procutil.py Sat Apr 07 21:21:03 2018 +0900 +++ b/mercurial/utils/procutil.py Sat Apr 07 21:23:42 2018 +0900 @@ -79,11 +79,11 @@ closefds = pycompat.isposix def explainexit(code): - """return a 2-tuple (desc, code) describing a subprocess status + """return a message describing a subprocess status (codes from kill are negative - not os.system/wait encoding)""" if code >= 0: - return _("exited with status %d") % code, code - return _("killed by signal %d") % -code, code + return _("exited with status %d") % code + return _("killed by signal %d") % -code class _pfile(object): """File-like wrapper for a stream opened by subprocess.Popen()""" @@ -179,7 +179,7 @@ code = 0 if code: raise error.Abort(_("command '%s' failed: %s") % - (cmd, explainexit(code)[0])) + (cmd, explainexit(code))) with open(outname, 'rb') as fp: return fp.read() finally: