eric6/DebugClients/Python/ThreadExtension.py

changeset 8240
93b8a353c4bf
parent 8218
7c09585bd960
child 8273
698ae46f40a4
--- a/eric6/DebugClients/Python/ThreadExtension.py	Wed Apr 14 19:38:19 2021 +0200
+++ b/eric6/DebugClients/Python/ThreadExtension.py	Wed Apr 14 19:59:16 2021 +0200
@@ -9,6 +9,7 @@
 
 import os
 import sys
+import contextlib
 
 import _thread
 import threading
@@ -95,9 +96,8 @@
         """
         self.lockClient()
         try:
-            del self.threads[threadId]
-        except KeyError:
-            pass
+            with contextlib.suppress(KeyError):
+                del self.threads[threadId]
         finally:
             self.unlockClient()
     
@@ -116,10 +116,8 @@
         """
         Public method to release the lock for this client.
         """
-        try:
+        with contextlib.suppress(RuntimeError):
             self.clientLock.release()
-        except RuntimeError:
-            pass
     
     def setCurrentThread(self, threadId):
         """

eric ide

mercurial