The race condition in comment #17 is only true if mystdout.closed can become True asynchronously before we have called mystdout.close(). I'm not sure if there's any possibility of that.
The race condition in comment #17 is only true if mystdout.closed can become True asynchronously before we have called mystdout.close(). I'm not sure if there's any possibility of that.