Comments
Patch
@@ -479,13 +479,6 @@ def testpid(pid):
except OSError as inst:
return inst.errno != errno.ESRCH
-def explainexit(code):
- """return a 2-tuple (desc, code) 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
-
def isowner(st):
"""Return True if the stat object st is from the current user."""
return st.st_uid == os.getuid()
@@ -52,7 +52,6 @@ if pycompat.iswindows:
else:
from .. import posix as platform
-explainexit = platform.explainexit
findexe = platform.findexe
_gethgcmd = platform.gethgcmd
getuser = platform.getuser
@@ -79,6 +78,13 @@ except AttributeError:
closefds = pycompat.isposix
+def explainexit(code):
+ """return a 2-tuple (desc, code) 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
+
class _pfile(object):
"""File-like wrapper for a stream opened by subprocess.Popen()"""
@@ -311,9 +311,6 @@ def quotecommand(cmd):
return '"' + cmd + '"'
return cmd
-def explainexit(code):
- return _("exited with status %d") % code, code
-
# if you change this stub into a real check, please try to implement the
# username and groupname functions above, too.
def isowner(st):