@@ -115,7 +115,7 @@ def loop(self, n):
115115 t:iteration_interval
116116 """
117117 interval = self .bob .iteration_interval ()
118- for i in range (n ):
118+ for _ in range (n ):
119119 self .alice .iterate ()
120120 self .bob .iterate ()
121121 sleep (interval / 2000.0 )
@@ -127,10 +127,7 @@ def loop_until_connected(self):
127127 """
128128
129129 def on_self_connection_status (self , status ):
130- if status != Tox .CONNECTION_NONE :
131- self .mycon_status = True
132- else :
133- self .mycon_status = False
130+ self .mycon_status = True if status != Tox .CONNECTION_NONE else False
134131 assert self .self_get_connection_status () == status
135132
136133 self .alice .mycon_status = False
@@ -160,7 +157,7 @@ def wait_callbacks(self, obj, attrs):
160157 count = 0
161158 THRESHOLD = 400
162159
163- while not all ([ getattr (obj , attr ) for attr in attrs ] ):
160+ while not all (getattr (obj , attr ) for attr in attrs ):
164161 self .loop (50 )
165162 if count >= THRESHOLD :
166163 return False
@@ -731,7 +728,6 @@ def on_file_recv_control2(self, fid, file_number, control):
731728 CONTEXT ['START' ] = True
732729 elif control == Tox .FILE_CONTROL_CANCEL :
733730 self .completed = True
734- pass
735731
736732 def on_file_chunk_request (self , fid , file_number , position , length ):
737733 if length == 0 :
@@ -759,8 +755,7 @@ def on_file_chunk_request(self, fid, file_number, position, length):
759755 BobTox .on_file_chunk_request = Tox .on_file_chunk_request
760756
761757if __name__ == '__main__' :
762- methods = set ([x for x in dir (Tox )
763- if not x [0 ].isupper () and not x [0 ] == '_' ])
758+ methods = {x for x in dir (Tox ) if not x [0 ].isupper () and x [0 ] != '_' }
764759 docs = "" .join ([getattr (ToxTest , x ).__doc__ for x in dir (ToxTest )
765760 if getattr (ToxTest , x ).__doc__ is not None ])
766761
0 commit comments