diff -r 59a9a658618c -r 93b8a353c4bf eric6/DebugClients/Python/ThreadExtension.py --- 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): """