Skip to content

Commit a5484ef

Browse files
Merge pull request #20 from ess-dmsc/all_return_bytes
All serialisation functions should return bytes
2 parents cf9d8db + 72f9fc1 commit a5484ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

streaming_data_types/eventdata_ev42.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ def serialise_ev42(
113113
# Generate the output and replace the file_identifier
114114
buffer = builder.Output()
115115
buffer[4:8] = FILE_IDENTIFIER
116-
return buffer
116+
return bytes(buffer)

streaming_data_types/logdata_f142.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _complete_buffer(
158158
timestamp_unix_ns: int,
159159
alarm_status: Union[int, None] = None,
160160
alarm_severity: Union[int, None] = None,
161-
) -> bytearray:
161+
) -> bytes:
162162
LogData.LogDataAddTimestamp(builder, timestamp_unix_ns)
163163

164164
if alarm_status is not None:
@@ -171,7 +171,7 @@ def _complete_buffer(
171171
builder.Finish(log_msg)
172172
buff = builder.Output()
173173
buff[4:8] = FILE_IDENTIFIER
174-
return buff
174+
return bytes(buff)
175175

176176

177177
def _setup_builder(source_name: str) -> Tuple[flatbuffers.Builder, int]:

0 commit comments

Comments
 (0)