From e6dca5e8f8d4160a6efed05f5275426e2d274542 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 14 May 2019 15:53:53 -0600 Subject: [PATCH] patman: Adjust functional tests for Python 3 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