[Lldb-commits] [lldb] r267562 - Fix send and receive of ACK byte in test infrastructure for Python 3.5

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 26 08:15:29 PDT 2016


Author: amccarth
Date: Tue Apr 26 10:15:29 2016
New Revision: 267562

URL: http://llvm.org/viewvc/llvm-project?rev=267562&view=rev
Log:
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

Modified:
    lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py?rev=267562&r1=267561&r2=267562&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py Tue Apr 26 10:15:29 2016
@@ -59,8 +59,7 @@ class UnpicklingForwardingReaderChannel(
         # 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):

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py?rev=267562&r1=267561&r2=267562&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py Tue Apr 26 10:15:29 2016
@@ -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)




More information about the lldb-commits mailing list