Sfoglia il codice sorgente

Fix lag when using cursor keys in an interactive 'fig run'

Aanand Prasad 11 anni fa
parent
commit
40d04a076c
1 ha cambiato i file con 13 aggiunte e 16 eliminazioni
  1. 13 16
      fig/cli/socketclient.py

+ 13 - 16
fig/cli/socketclient.py

@@ -91,22 +91,19 @@ class SocketClient:
 
     def send(self, socket, stream):
         while True:
-            r, w, e = select([stream.fileno()], [], [])
-
-            if r:
-                chunk = stream.read(1)
-
-                if chunk == '':
-                    socket.close()
-                    break
-                else:
-                    try:
-                        socket.send(chunk)
-                    except Exception as e:
-                        if hasattr(e, 'errno') and e.errno == errno.EPIPE:
-                            break
-                        else:
-                            raise e
+            chunk = stream.read(1)
+
+            if chunk == '':
+                socket.close()
+                break
+            else:
+                try:
+                    socket.send(chunk)
+                except Exception as e:
+                    if hasattr(e, 'errno') and e.errno == errno.EPIPE:
+                        break
+                    else:
+                        raise e
 
     def destroy(self):
         if self.settings is not None: