--- a/src/eric7/Debugger/DebuggerInterfacePython.py Sun Oct 06 10:10:08 2024 +0200 +++ b/src/eric7/Debugger/DebuggerInterfacePython.py Sun Oct 06 12:18:51 2024 +0200 @@ -863,9 +863,10 @@ self.__mainDebugger, jsonStr ) else: - conn = self.__connections[self.__mainDebugger] - for jsonStr in self.__commandQueue: - self.__writeJsonCommandToSocket(jsonStr, conn) + with contextlib.suppress(KeyError): + conn = self.__connections[self.__mainDebugger] + for jsonStr in self.__commandQueue: + self.__writeJsonCommandToSocket(jsonStr, conn) self.__commandQueue.clear()