@@ -835,13 +835,15 @@ def reconnect(self, resub_topics=True):
835835 self .subscribe (feed )
836836
837837 def loop (self , timeout = 0 ):
838+ # pylint: disable = too-many-return-statements
838839 """Non-blocking message loop. Use this method to
839840 check incoming subscription messages.
840841 Returns response codes of any messages received.
841842
842843 :param int timeout: Socket timeout, in seconds.
843844
844845 """
846+
845847 if self ._timestamp == 0 :
846848 self ._timestamp = time .monotonic ()
847849 current_time = time .monotonic ()
@@ -857,22 +859,25 @@ def loop(self, timeout=0):
857859
858860 stamp = time .monotonic ()
859861 self ._sock .settimeout (timeout )
860- responses = []
862+ rcs = []
863+
861864 while True :
862865 rc = self ._wait_for_msg ()
863- if rc is None :
866+ if rc is None :
864867 break
865868 if time .monotonic () - stamp > self ._recv_timeout :
866869 if self .logger is not None :
867870 self .logger .debug (
868871 f"Loop timed out, message queue not empty after { self ._recv_timeout } s"
869872 )
870873 break
871- responses .append (rc )
874+ rcs .append (rc )
872875
873- return responses if responses else None
876+ return rcs if rcs else None
874877
875878 def _wait_for_msg (self , timeout = 0.1 ):
879+ # pylint: disable = too-many-return-statements
880+
876881 """Reads and processes network events."""
877882 # CPython socket module contains a timeout attribute
878883 if hasattr (self ._socket_pool , "timeout" ):
0 commit comments