Skip to content

Commit 17bdb7a

Browse files
committed
[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'.
1 parent 18eae33 commit 17bdb7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def test_create_after_attach_with_fork(self):
5353
stdin=subprocess.PIPE,
5454
stdout=subprocess.PIPE,
5555
stderr=subprocess.PIPE)
56-
outs, errs = capture.communicate()
56+
outs, _ = capture.communicate()
57+
outs = outs.decode('utf-8')
5758
self.assertIn('Process {} stopped'.format(pid), outs)
5859
self.assertIn('Reproducer written', outs)
5960

@@ -63,7 +64,8 @@ def test_create_after_attach_with_fork(self):
6364
stdin=subprocess.PIPE,
6465
stdout=subprocess.PIPE,
6566
stderr=subprocess.PIPE)
66-
outs, errs = replay.communicate()
67+
outs, _ = replay.communicate()
68+
outs = outs.decode('utf-8')
6769
self.assertIn('Process {} stopped'.format(pid), outs)
6870

6971
# We can dump the reproducer in the current context.

0 commit comments

Comments
 (0)