Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self._has_sync:
self._find_sync(header.msg_size)
except IndexError:
if not self._file_corrupt:
print("File corruption detected while reading file data!")
self._file_corrupt = True
except struct.error:
pass #we read past the end of the file
# convert into final representation
while self._subscriptions:
_, value = self._subscriptions.popitem()
if len(value.buffer) > 0: # only add if we have data
data_item = ULog.Data(value)
self._data_list.append(data_item)