##// END OF EJS Templates
procutil: unify platform.explainexit()...
Yuya Nishihara -
r37478:a6c6b7be default
parent child Browse files
Show More
@@ -479,13 +479,6 b' def testpid(pid):'
479 except OSError as inst:
479 except OSError as inst:
480 return inst.errno != errno.ESRCH
480 return inst.errno != errno.ESRCH
481
481
482 def explainexit(code):
483 """return a 2-tuple (desc, code) describing a subprocess status
484 (codes from kill are negative - not os.system/wait encoding)"""
485 if code >= 0:
486 return _("exited with status %d") % code, code
487 return _("killed by signal %d") % -code, -code
488
489 def isowner(st):
482 def isowner(st):
490 """Return True if the stat object st is from the current user."""
483 """Return True if the stat object st is from the current user."""
491 return st.st_uid == os.getuid()
484 return st.st_uid == os.getuid()
@@ -52,7 +52,6 b' if pycompat.iswindows:'
52 else:
52 else:
53 from .. import posix as platform
53 from .. import posix as platform
54
54
55 explainexit = platform.explainexit
56 findexe = platform.findexe
55 findexe = platform.findexe
57 _gethgcmd = platform.gethgcmd
56 _gethgcmd = platform.gethgcmd
58 getuser = platform.getuser
57 getuser = platform.getuser
@@ -79,6 +78,13 b' except AttributeError:'
79
78
80 closefds = pycompat.isposix
79 closefds = pycompat.isposix
81
80
81 def explainexit(code):
82 """return a 2-tuple (desc, code) describing a subprocess status
83 (codes from kill are negative - not os.system/wait encoding)"""
84 if code >= 0:
85 return _("exited with status %d") % code, code
86 return _("killed by signal %d") % -code, -code
87
82 class _pfile(object):
88 class _pfile(object):
83 """File-like wrapper for a stream opened by subprocess.Popen()"""
89 """File-like wrapper for a stream opened by subprocess.Popen()"""
84
90
@@ -311,9 +311,6 b' def quotecommand(cmd):'
311 return '"' + cmd + '"'
311 return '"' + cmd + '"'
312 return cmd
312 return cmd
313
313
314 def explainexit(code):
315 return _("exited with status %d") % code, code
316
317 # if you change this stub into a real check, please try to implement the
314 # if you change this stub into a real check, please try to implement the
318 # username and groupname functions above, too.
315 # username and groupname functions above, too.
319 def isowner(st):
316 def isowner(st):
General Comments 0
You need to be logged in to leave comments. Login now