eric6/Utilities/BackgroundClient.py

changeset 8240
93b8a353c4bf
parent 8207
d359172d11be
child 8243
cc717c2ae956
diff -r 59a9a658618c -r 93b8a353c4bf eric6/Utilities/BackgroundClient.py
--- a/eric6/Utilities/BackgroundClient.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/Utilities/BackgroundClient.py	Wed Apr 14 19:59:16 2021 +0200
@@ -16,6 +16,7 @@
 import sys
 import time
 import traceback
+import contextlib
 from zlib import adler32
 
 
@@ -124,9 +125,8 @@
         data = b''
         self.connection.setblocking(False)
         try:
-            data = self.connection.recv(length, socket.MSG_PEEK)
-        except OSError:
-            pass
+            with contextlib.suppress(OSError):
+                data = self.connection.recv(length, socket.MSG_PEEK)
         finally:
             self.connection.setblocking(True)
         

eric ide

mercurial