diff options
author | Devaev Maxim <[email protected]> | 2020-10-13 17:27:36 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-10-13 17:27:36 +0300 |
commit | bee33f2df629a702dd61345e14d807720b94e3e9 (patch) | |
tree | 1b363681425cf7c7d1665c511e55821c8f2bfb9f /kvmd/plugins/hid/otg | |
parent | 23ff97ba95e75f25018bafd076e4f76cbbb598f9 (diff) |
tools.clear_queue()
Diffstat (limited to 'kvmd/plugins/hid/otg')
-rw-r--r-- | kvmd/plugins/hid/otg/device.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py index bead6d59..3fad9d3c 100644 --- a/kvmd/plugins/hid/otg/device.py +++ b/kvmd/plugins/hid/otg/device.py @@ -31,6 +31,7 @@ from typing import Dict from ....logging import get_logger +from .... import tools from .... import aiomulti from .... import aioproc @@ -134,11 +135,7 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in self.__events_queue.put_nowait(event) def _clear_queue(self) -> None: - while not self.__events_queue.empty(): - try: - self.__events_queue.get_nowait() - except queue.Empty: - break + tools.clear_queue(self.__events_queue) def _ensure_write(self, report: bytes, reopen: bool=False, close: bool=False) -> bool: if reopen: |