Skip to content

Commit e760ed2

Browse files
authored
Update spikegadgetsrawio.py
Fix issue #1432.
1 parent dfebe06 commit e760ed2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

neo/rawio/spikegadgetsrawio.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ def _parse_header(self):
107107
stream_bytes = {}
108108
for device in hconf:
109109
stream_id = device.attrib["name"]
110-
num_bytes = int(device.attrib["numBytes"])
111-
stream_bytes[stream_id] = packet_size
112-
packet_size += num_bytes
110+
if 'numBytes' in device.attrib.keys():
111+
num_bytes = int(device.attrib["numBytes"])
112+
stream_bytes[stream_id] = packet_size
113+
packet_size += num_bytes
113114

114115
# timestamps 4 uint32
115116
self._timestamp_byte = packet_size
@@ -139,7 +140,7 @@ def _parse_header(self):
139140
# TODO LATER: deal with "headstageSensor" which have interleaved
140141
continue
141142

142-
if channel.attrib["dataType"] == "analog":
143+
if ('dataType' in channel.attrib.keys()) and (channel.attrib["dataType"] == "analog"):
143144

144145
if stream_id not in stream_ids:
145146
stream_ids.append(stream_id)

0 commit comments

Comments
 (0)