mercurial/posix.py
changeset 37460 a6c6b7beb025
parent 37459 90c5ca718781
child 37934 2d919ab6c5b4
equal deleted inserted replaced
37459:90c5ca718781 37460:a6c6b7beb025
   477         os.kill(pid, 0)
   477         os.kill(pid, 0)
   478         return True
   478         return True
   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()
   492 
   485 
   493 def findexe(command):
   486 def findexe(command):