def run(self):
""" Run the parentpoller.
"""
# We cannot use os.waitpid because it works only for child processes.
from errno import EINTR
while True:
try:
if os.getppid() == 1:
if hasattr(self.quitfunction, '__call__'):
self.quitfunction()
waitForClose()
os._exit(1)
time.sleep(1.0)
except OSError as e:
if e.errno == EINTR:
continue
raise
评论列表
文章目录