diff --git a/AWSIoTPythonSDK/core/greengrass/discovery/providers.py b/AWSIoTPythonSDK/core/greengrass/discovery/providers.py index 47235c9..b09dfed 100644 --- a/AWSIoTPythonSDK/core/greengrass/discovery/providers.py +++ b/AWSIoTPythonSDK/core/greengrass/discovery/providers.py @@ -366,9 +366,14 @@ def _receive_until(self, ssl_sock, criteria_function, extra_data=None): start_time = time.time() response = bytearray() number_bytes_read = 0 + ssl_sock_tmp = None while True: # Python does not have do-while try: - response.extend(self._convert_to_int_py3(ssl_sock.read(1))) + ssl_sock_tmp = self._convert_to_int_py3(ssl_sock.read(1)) + if ssl_sock_tmp is list: + response.extend(ssl_sock_tmp) + else: + response.append(ssl_sock_tmp) number_bytes_read += 1 except socket.error as err: if err.errno == ssl.SSL_ERROR_WANT_READ or err.errno == ssl.SSL_ERROR_WANT_WRITE: