autotest: remove dependency on getppid()
makes pysim more windows friendly
This commit is contained in:
parent
57c498b570
commit
8b21cac5fd
@ -202,8 +202,15 @@ def lock_file(fname):
|
|||||||
return None
|
return None
|
||||||
return f
|
return f
|
||||||
|
|
||||||
def check_parent(parent_pid=os.getppid()):
|
def check_parent(parent_pid=None):
|
||||||
'''check our parent process is still alive'''
|
'''check our parent process is still alive'''
|
||||||
|
if parent_pid is None:
|
||||||
|
try:
|
||||||
|
parent_pid = os.getppid()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
if parent_pid is None:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
os.kill(parent_pid, 0)
|
os.kill(parent_pid, 0)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user