From patchwork Sun Apr 5 15:21:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 237193 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 5 Apr 2020 09:21:20 -0600 Subject: [PATCH 11/22] patman: Update flushing Print() for Python 3 In-Reply-To: <20200405152131.98147-1-sjg@chromium.org> References: <20200405152131.98147-1-sjg@chromium.org> Message-ID: <20200405092116.11.I9d8a5afe3f0d9fccfb1f768d754f98b58c365e33@changeid> This does not seem to work on Python 3. Update the code to use the built-in support. Signed-off-by: Simon Glass --- tools/patman/terminal.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py index 7a3b658b00e..6541fa8f410 100644 --- a/tools/patman/terminal.py +++ b/tools/patman/terminal.py @@ -53,11 +53,10 @@ def Print(text='', newline=True, colour=None): if colour: col = Color() text = col.Color(colour, text) - print(text, end='') if newline: - print() + print(text) else: - sys.stdout.flush() + print(text, end='', flush=True) def SetPrintTestMode(): """Go into test mode, where all printing is recorded"""