From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 28 Dec 2020 20:34:58 -0700 Subject: [PATCH 12/49] concurrencytest: Fix Python3 warning In-Reply-To: <20201229033535.99990-1-sjg@chromium.org> References: <20201229033535.99990-1-sjg@chromium.org> Message-ID: <20201229033535.99990-13-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This gives a warning in some situations: File "tools/dtoc/../concurrencytest/concurrencytest.py", line 95, in do_fork stream = os.fdopen(c2pread, 'rb', 1) File "/usr/lib/python3.8/os.py", line 1023, in fdopen return io.open(fd, *args, **kwargs) RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used Fix this by dropping the line-buffer parameter. Signed-off-by: Simon Glass --- tools/concurrencytest/concurrencytest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/concurrencytest/concurrencytest.py b/tools/concurrencytest/concurrencytest.py index 418d7eed21d..5e88b94f415 100644 --- a/tools/concurrencytest/concurrencytest.py +++ b/tools/concurrencytest/concurrencytest.py @@ -68,7 +68,7 @@ def fork_for_tests(concurrency_num=CPU_COUNT): pid = os.fork() if pid == 0: try: - stream = os.fdopen(c2pwrite, 'wb', 1) + stream = os.fdopen(c2pwrite, 'wb') os.close(c2pread) # Leave stderr and stdout open so we can see test noise # Close stdin so that the child goes away if it decides to @@ -92,7 +92,7 @@ def fork_for_tests(concurrency_num=CPU_COUNT): os._exit(0) else: os.close(c2pwrite) - stream = os.fdopen(c2pread, 'rb', 1) + stream = os.fdopen(c2pread, 'rb') test = ProtocolTestCase(stream) result.append(test) return result -- 2.29.2.729.g45daf8777d-goog