From 17bdb7a17912bb4d961cf292c035b08c9d0c13ba Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 13 Mar 2020 09:49:00 -0700 Subject: [PATCH] [lldb/Test] Convert stdout to str by calling decode('utf-8') on it. Make sure both arguments to assertIn are of type str. This should fix the following error: TypeError: a bytes-like object is required, not 'str'. --- .../API/functionalities/reproducers/attach/TestReproducerAttach.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py b/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py index 48659e4..9bc123a 100644 --- a/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py +++ b/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py @@ -53,7 +53,8 @@ class CreateAfterAttachTestCase(TestBase): stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - outs, errs = capture.communicate() + outs, _ = capture.communicate() + outs = outs.decode('utf-8') self.assertIn('Process {} stopped'.format(pid), outs) self.assertIn('Reproducer written', outs) @@ -63,7 +64,8 @@ class CreateAfterAttachTestCase(TestBase): stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - outs, errs = replay.communicate() + outs, _ = replay.communicate() + outs = outs.decode('utf-8') self.assertIn('Process {} stopped'.format(pid), outs) # We can dump the reproducer in the current context. -- 2.7.4