Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -2227,6 +2227,10 @@ # Get the error text if there was an error, and the regular text if not. output = self.res.GetOutput() if self.res.Succeeded() \ else self.res.GetError() + # In Python 2, communicate sends byte strings. In Python 3, communicate sends bytes. + # If we got a string (and not a byte string), encode it before sending. + if isinstance(output, str) and not isinstance(output, bytes): + output = output.encode() # Assemble the absolute path to the check file. As a convenience for # LLDB inline tests, assume that the check file is a relative path to