From d769742768d891a2ef868925ca35ae5e6b4e23f3 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 14 Oct 2020 17:01:10 +0300 Subject: [PATCH] serial hid: clear events on exceptions --- kvmd/plugins/hid/serial.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kvmd/plugins/hid/serial.py b/kvmd/plugins/hid/serial.py index 0eaacfb7..17378e6a 100644 --- a/kvmd/plugins/hid/serial.py +++ b/kvmd/plugins/hid/serial.py @@ -348,12 +348,14 @@ class Plugin(BaseHid, multiprocessing.Process): # pylint: disable=too-many-inst self.clear_events() except serial.SerialException as err: + self.clear_events() if err.errno == errno.ENOENT: logger.error("Missing HID serial device: %s", self.__device_path) else: logger.exception("Unexpected HID error") except Exception: + self.clear_events() logger.exception("Unexpected HID error") finally: