Alternatively we could just have a busy wait there and only exit the tempdir context once we know we have a pid file and can clean ourselves up.
while not os.path.exists(pid_file): pass
Alternatively we could just have a busy wait there and only exit the tempdir context once we know we have a pid file and can clean ourselves up.
while not os.path. exists( pid_file) :
pass