RefactoringRope/JsonClient.py

changeset 290
6b3530ce34d0
parent 245
75a35a927952
child 302
2e853e2f2430
--- a/RefactoringRope/JsonClient.py	Sat Nov 10 17:40:03 2018 +0100
+++ b/RefactoringRope/JsonClient.py	Sun Nov 11 17:44:55 2018 +0100
@@ -122,13 +122,21 @@
         Public method implementing the main loop of the client.
         """
         try:
+            selectErrors = 0
             while True:
                 try:
                     rrdy, wrdy, xrdy = select.select(
                         [self.__connection], [], [])
                 except (select.error, KeyboardInterrupt, socket.error):
-                    # just carry on
-                    continue
+                    selectErrors += 1
+                    if selectErrors <= 10:      # selected arbitrarily
+                        # just carry on
+                        continue
+                    else:
+                        break
+                
+                # reset select errors
+                selectErrors = 0
                 
                 if self.__connection in rrdy:
                     method, params = self.__receiveJson()

eric ide

mercurial