diff --git a/spinnman/processes/read_memory_process.py b/spinnman/processes/read_memory_process.py index 0310729d6..cad527977 100644 --- a/spinnman/processes/read_memory_process.py +++ b/spinnman/processes/read_memory_process.py @@ -41,8 +41,8 @@ def __handle_response(self, offset: int, response: Response): self._view[offset:offset + response.length] = response.data[ response.offset:response.offset + response.length] - def read_memory( - self, coordinates: XYP, base_address: int, length: int) -> bytes: + def read_memory(self, coordinates: XYP, base_address: int, + length: int) -> bytearray: """ Read some memory from a core. @@ -56,7 +56,7 @@ def read_memory( functools.partial(ReadMemory, coordinates)) def read_link_memory(self, coordinates: XYP, link: int, - base_address: int, length: int) -> bytes: + base_address: int, length: int) -> bytearray: """ Read some memory from the neighbour of a core. @@ -73,7 +73,7 @@ def read_link_memory(self, coordinates: XYP, link: int, def _read_memory( self, base_address: int, length: int, packet_class: Callable[ - [int, int], AbstractSCPRequest[Response]]) -> bytes: + [int, int], AbstractSCPRequest[Response]]) -> bytearray: data = bytearray(length) self._view = memoryview(data) n_bytes = length @@ -88,4 +88,4 @@ def _read_memory( n_bytes -= bytes_to_get offset += bytes_to_get - return bytes(data) + return data diff --git a/spinnman/transceiver/base_transceiver.py b/spinnman/transceiver/base_transceiver.py index a068195fc..65e4139e6 100644 --- a/spinnman/transceiver/base_transceiver.py +++ b/spinnman/transceiver/base_transceiver.py @@ -979,7 +979,7 @@ def write_user( @overrides(Transceiver.read_memory) def read_memory( self, x: int, y: int, base_address: int, length: int, - cpu: int = 0) -> bytes: + cpu: int = 0) -> bytearray: try: process = ReadMemoryProcess(self._scamp_connection_selector) return process.read_memory((x, y, cpu), base_address, length)