Skip to content

Commit

Permalink
Replaced try-catch with if-else + key in list check
Browse files Browse the repository at this point in the history
Addresses PR comments.
  • Loading branch information
Ryangwaite committed Jul 3, 2024
1 parent 5056c12 commit 6467d01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ansible/roles/test/files/ptftests/py3/advanced-reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2005,10 +2005,10 @@ def examine_flow(self, filename=None):
prev_pkt_pt = prev_payload + 1
prev_sent_packet_time = None
while prev_pkt_pt < received_payload:
try:
if prev_pkt_pt in sent_packets:
prev_sent_packet_time = sent_packets[prev_pkt_pt]
break # Found it
except KeyError:
else:
if prev_pkt_pt not in received_but_not_sent_packets:
missing_sent_and_received_pkt_count += 1
prev_pkt_pt += 1
Expand Down

0 comments on commit 6467d01

Please sign in to comment.