diff --git a/bitelab/__main__.py b/bitelab/__main__.py index f3bc49a..1b05544 100644 --- a/bitelab/__main__.py +++ b/bitelab/__main__.py @@ -318,8 +318,8 @@ class TestExecClient(unittest.IsolatedAsyncioTestCase): stdin_task = loop.run_in_executor(None, self.copytask, io.BytesIO(stdin), stdinwriter) - # do not close stdout, otherwise we cannot obtain - # the value + # do not close stdout, otherwise we cannot call + # getvalue on BytesIO object stdout_task = loop.run_in_executor(None, self.copytask, stdoutreader, stdout, False) @@ -335,11 +335,8 @@ class TestExecClient(unittest.IsolatedAsyncioTestCase): except SystemExit as e: ret = e.code - # No one to read anything anymore - stdinwriter.close() - stdinreader.close() - # No one to write anything anymore + # close so stdout_task will end stdoutwriter.close() # make sure all the data has been copied