+
+ # Don't actually try to close it.. just wait until it closes by itself
+ # We can't actually kill the pid which is what it's trying to do, and if
+ # we call wait we could be in an unfortunate situation of it printing input
+ # right as we call wait, so the input is never read and the process never ends
+ def safe_close(self):
+ count = 0
+ while self.isalive() and count < 10:
+ time.sleep(1)
+ self.close(force=False)
+