Skip to content

Commit d285007

Browse files
committedApr 26, 2016
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
1 parent 0937a7d commit d285007

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
 

Diff for: ‎lldb/packages/Python/lldbsuite/test_event/dotest_channels.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def __init__(self, file_object, async_map, forwarding_func):
5959
# the initiators of the socket to await this to ensure
6060
# that this end is up and running (and therefore already
6161
# into the async map).
62-
ack_bytes = bytearray()
63-
ack_bytes.append(chr(42))
62+
ack_bytes = b'*'
6463
file_object.send(ack_bytes)
6564

6665
def deserialize_payload(self):

Diff for: ‎lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ def __init__(self, formatter, cleanup_func):
4040
self.cleanup_func = cleanup_func
4141

4242

43-
SOCKET_ACK_BYTE_VALUE = b'*' # ASCII for chr(42)
44-
45-
4643
def create_results_formatter(config):
4744
"""Sets up a test results formatter.
4845
@@ -78,7 +75,7 @@ def socket_closer(open_sock):
7875
# listener socket gets spun up; otherwise,
7976
# we lose the test result info.
8077
read_bytes = sock.recv(1)
81-
if read_bytes is None or (len(read_bytes) < 1) or (read_bytes[0] != SOCKET_ACK_BYTE_VALUE):
78+
if read_bytes is None or (len(read_bytes) < 1) or (read_bytes != b'*'):
8279
raise Exception("listening socket did not respond with ack byte: response={}".format(read_bytes))
8380

8481
return sock, lambda: socket_closer(sock)

0 commit comments

Comments
 (0)
Please sign in to comment.