4141 stats_time ,
4242)
4343
44-
4544version_string = "2ping {} - {}" .format (__version__ , platform_info ())
4645clock = time .perf_counter
4746
@@ -223,7 +222,7 @@ def handle_socket_error(self, e, sock_class, peer_address=None):
223222 error_string = str (e )
224223 try :
225224 MSG_ERRQUEUE = 8192
226- ( error_data , error_address ) = sock .recvfrom (16384 , MSG_ERRQUEUE )
225+ error_data , error_address = sock .recvfrom (16384 , MSG_ERRQUEUE )
227226 print_address = error_address [0 ]
228227 except socket .error :
229228 if peer_address :
@@ -331,7 +330,7 @@ def process_incoming_packet(self, sock_class):
331330 )
332331 )
333332 return
334- ( test_begin , test_length ) = packet_in .opcode_data_positions [packets .OpcodeHMAC .id ]
333+ test_begin , test_length = packet_in .opcode_data_positions [packets .OpcodeHMAC .id ]
335334 test_begin += 2
336335 test_length -= 2
337336 packet_in .opcodes [packets .OpcodeHMAC .id ].key = self .args .auth .encode ("UTF-8" )
@@ -355,7 +354,7 @@ def process_incoming_packet(self, sock_class):
355354 if packets .OpcodeInReplyTo .id in packet_in .opcodes :
356355 replied_message_id = packet_in .opcodes [packets .OpcodeInReplyTo .id ].message_id
357356 if replied_message_id in peer_state .sent_messages :
358- ( sent_time , _unused , ping_position ) = peer_state .sent_messages [replied_message_id ]
357+ sent_time , _unused , ping_position = peer_state .sent_messages [replied_message_id ]
359358 del peer_state .sent_messages [replied_message_id ]
360359
361360 calculated_rtt = (time_begin - sent_time ) * 1000
@@ -536,7 +535,7 @@ def sock_sendto(self, sock_class, data, address=None):
536535 def sock_recvfrom (self , sock_class ):
537536 sock = sock_class .sock
538537 try :
539- ( data , peer_address ) = sock .recvfrom (16384 )
538+ data , peer_address = sock .recvfrom (16384 )
540539 except socket .error as e :
541540 self .handle_socket_error (e , sock_class )
542541 return
@@ -563,7 +562,7 @@ def start_investigations(self, peer_state, packet_check):
563562 iobj = None
564563 now = clock ()
565564 for message_id_str in peer_state .sent_messages :
566- ( sent_time , message_id , _unused ) = peer_state .sent_messages [message_id_str ]
565+ sent_time , message_id , _unused = peer_state .sent_messages [message_id_str ]
567566 if now >= (sent_time + self .args .inquire_wait ):
568567 if iobj is None :
569568 iobj = packets .OpcodeInvestigate ()
@@ -584,7 +583,7 @@ def check_investigations(self, peer_state, packet_check):
584583 for message_id in packet_check .opcodes [opcode_id ].message_ids :
585584 if message_id not in peer_state .sent_messages :
586585 continue
587- ( _unused , _unused , ping_seq ) = peer_state .sent_messages [message_id ]
586+ _unused , _unused , ping_seq = peer_state .sent_messages [message_id ]
588587 if peer_state .peer_tuple [1 ]:
589588 address = peer_state .peer_tuple [1 ][0 ]
590589 else :
@@ -601,7 +600,7 @@ def check_investigations(self, peer_state, packet_check):
601600 return
602601 # Print results
603602 for ping_seq in sorted (found ):
604- ( loss_type , address ) = found [ping_seq ]
603+ loss_type , address = found [ping_seq ]
605604 if loss_type == "inbound" :
606605 loss_message = "Lost inbound packet from {address}: ping_seq={seq}"
607606 else :
0 commit comments