diff options
author | Adrian McCarthy <amccarth@google.com> | 2016-04-26 15:15:29 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2016-04-26 15:15:29 +0000 |
commit | d285007720169bd1054cadfe65c3a5da84997d19 (patch) | |
tree | e1ba3ccaa67dc7feb145e00262650f1869148092 /lldb/packages/Python/lldbsuite | |
parent | 0937a7d8143056c43918642e5d2b444deee9dbb0 (diff) | |
download | bcm5719-llvm-d285007720169bd1054cadfe65c3a5da84997d19.tar.gz bcm5719-llvm-d285007720169bd1054cadfe65c3a5da84997d19.zip |
Fix send and receive of ACK byte in test infrastructure for Python 3.5
Python 3.5 is pickier about the distinction between chars and bytes (and strings and bytearrays) than Python 2.7.
Differential Revision: http://reviews.llvm.org/D19510
llvm-svn: 267562
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test_event/dotest_channels.py | 3 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test_event/dotest_channels.py b/lldb/packages/Python/lldbsuite/test_event/dotest_channels.py index 72ff9bd85f1..d69720e4f66 100644 --- a/lldb/packages/Python/lldbsuite/test_event/dotest_channels.py +++ b/lldb/packages/Python/lldbsuite/test_event/dotest_channels.py @@ -59,8 +59,7 @@ class UnpicklingForwardingReaderChannel(asyncore.dispatcher): # the initiators of the socket to await this to ensure # that this end is up and running (and therefore already # into the async map). - ack_bytes = bytearray() - ack_bytes.append(chr(42)) + ack_bytes = b'*' file_object.send(ack_bytes) def deserialize_payload(self): diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py b/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py index f00766c5d38..5a07af6c41a 100644 --- a/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py +++ b/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py @@ -40,9 +40,6 @@ class CreatedFormatter(object): self.cleanup_func = cleanup_func -SOCKET_ACK_BYTE_VALUE = b'*' # ASCII for chr(42) - - def create_results_formatter(config): """Sets up a test results formatter. @@ -78,7 +75,7 @@ def create_results_formatter(config): # listener socket gets spun up; otherwise, # we lose the test result info. read_bytes = sock.recv(1) - if read_bytes is None or (len(read_bytes) < 1) or (read_bytes[0] != SOCKET_ACK_BYTE_VALUE): + if read_bytes is None or (len(read_bytes) < 1) or (read_bytes != b'*'): raise Exception("listening socket did not respond with ack byte: response={}".format(read_bytes)) return sock, lambda: socket_closer(sock) |