[crans_utils] process_status sans utiliser subprocess
This commit is contained in:
parent
a485d4b8b2
commit
954ba580b6
1 changed files with 4 additions and 4 deletions
|
@ -216,11 +216,11 @@ def process_status(pid):
|
|||
"""
|
||||
Vérifie l'état du processus pid
|
||||
"""
|
||||
cmd = subprocess.call(['ps', '%s' % pid], stdout=DEVNULL, stderr=subprocess.STDOUT)
|
||||
if cmd != 0:
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
os.getpgid(int(pid))
|
||||
return True
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
def escape(chaine):
|
||||
"""Renvoie une chaîne échapée pour pouvoir la mettre en toute sécurité
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue