Skip to content

Commit

Permalink
fix(packets): correct dict iteration syntax in Telemetry.identify_packet
Browse files Browse the repository at this point in the history
The method was attempting to iterate over target_packets using tuple unpacking, but `.items()`
was missing from the dict iteration. This would cause a TypeError since Python dictionaries
require `.items()` for key-value pair iteration.

Changed:
`for _, packet in target_packets:`
to:
`for _, packet in target_packets.items():`

This ensures proper dictionary key-value pair iteration when identifying packets in tlm_unique_id_mode.
  • Loading branch information
badrobit committed Feb 5, 2025
1 parent 48a3666 commit 0066d71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openc3/python/openc3/packets/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def identify(self, packet_data, target_names=None):
target = self.system.targets[target_name]
if target and target.tlm_unique_id_mode:
# Iterate through the packets and see if any represent the buffer
for _, packet in target_packets:
for _, packet in target_packets.items():
if packet.identify(packet_data):
return packet
else:
Expand Down

0 comments on commit 0066d71

Please sign in to comment.