diff options
author | Pavel Labath <pavel@labath.sk> | 2019-02-19 08:25:25 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-02-19 08:25:25 +0000 |
commit | 499611a20ffae5fcec25655e36502d44603d717f (patch) | |
tree | ee1dc2b38ffaa93e3d6cbbf0ecceb0c13365d76c /lldb/packages/Python/lldbsuite/test/tools | |
parent | eebf32fad62eb1e6972df8d1809aaebf457ab477 (diff) | |
download | bcm5719-llvm-499611a20ffae5fcec25655e36502d44603d717f.tar.gz bcm5719-llvm-499611a20ffae5fcec25655e36502d44603d717f.zip |
Fix vscode tests for python3
encode/decode the data before sending it over the socket. Since (AFAICT)
the vscode protocol (unlike the gdb-remote one) is fully textual, using
the utf8 codec here is appropriate.
llvm-svn: 354308
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py index 066158d0877..99986bc96a2 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py @@ -54,7 +54,7 @@ def read_packet(f, verbose=False, trace_file=None): '''Decode a JSON packet that starts with the content length and is followed by the JSON bytes from a file 'f' ''' - line = f.readline() + line = f.readline().decode("utf-8") if len(line) == 0: return None @@ -121,7 +121,7 @@ class DebugCommunication(object): @classmethod def encode_content(cls, s): - return "Content-Length: %u\r\n\r\n%s" % (len(s), s) + return ("Content-Length: %u\r\n\r\n%s" % (len(s), s)).encode("utf-8") @classmethod def validate_response(cls, command, response): |