diff options
author | Zachary Turner <zturner@google.com> | 2016-01-27 19:00:51 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-01-27 19:00:51 +0000 |
commit | 671e6340da589fe94d30fa97fb3c89318881a775 (patch) | |
tree | 9ca438b32799605efaa0b2b22adf26fa265ea937 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | e89a66bd4a30a9c421405f56aa93ce6818fdddc7 (diff) | |
download | bcm5719-llvm-671e6340da589fe94d30fa97fb3c89318881a775.tar.gz bcm5719-llvm-671e6340da589fe94d30fa97fb3c89318881a775.zip |
Resubmit r258759 with proper unicode handling.
Instead of opening the file in unicode mode, we need only encode
data which potentially has non-ASCII characters as UTF8 before
writing. This should work across both Python versions, and is
also far simpler than anything else discussed.
llvm-svn: 258969
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 61355a86129..e5fdd6e6faf 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -262,7 +262,7 @@ class recording(SixStringIO): if self.trace: print(self.getvalue(), file=sys.stderr) if self.session: - print(self.getvalue(), file=self.session) + print(self.getvalue().encode(), file=self.session) self.close() @add_metaclass(abc.ABCMeta) @@ -1843,7 +1843,7 @@ class Base(unittest2.TestCase): if not self.__unexpected__ and not self.__skipped__: for test, traceback in pairs: if test is self: - print(traceback, file=self.session) + print(traceback.encode(), file=self.session) # put footer (timestamp/rerun instructions) into session testMethod = getattr(self, self._testMethodName) |