From: Simon Glass Date: Tue, 14 May 2019 15:53:53 -0600 Subject: [U-Boot] [PATCH 19/21] patman: Adjust functional tests for Python 3 In-Reply-To: <20190514215355.246399-1-sjg@chromium.org> References: <20190514215355.246399-1-sjg@chromium.org> Message-ID: <20190514215355.246399-20-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Change the code so that it works on both Python 2 and Python 3. This works by using unicode instead of latin1 for the test input, and ensuring that the output is converted to a string rather than a unicode object on Python 2. Signed-off-by: Simon Glass --- tools/patman/func_test.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index f7d5ad68f6..50a2741439 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -129,10 +129,10 @@ class TestFunctional(unittest.TestCase): """ process_tags = True ignore_bad_tags = True - stefan = u'Stefan Brüns ' + stefan = b'Stefan Br\xc3\xbcns '.decode('utf-8') rick = 'Richard III ' - mel = u'Lord Mëlchett ' - ed = u'Lond Edmund Blackaddër '.decode('utf-8') + ed = b'Lond Edmund Blackadd\xc3\xabr