From 4c3c063ace6b1854dbc087fbfb7b9ad473dad95d Mon Sep 17 00:00:00 2001 From: doronz Date: Sun, 29 Oct 2023 07:54:45 +0200 Subject: [PATCH] win32: fix flake8 errors --- src/prompt_toolkit/input/win32.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prompt_toolkit/input/win32.py b/src/prompt_toolkit/input/win32.py index 9ad72aee1..35e8948d2 100644 --- a/src/prompt_toolkit/input/win32.py +++ b/src/prompt_toolkit/input/win32.py @@ -314,10 +314,10 @@ def _get_keys( # Process if this is a key event. (We also have mouse, menu and # focus events.) - if type(ev) == KEY_EVENT_RECORD and ev.KeyDown: + if isinstance(ev, KEY_EVENT_RECORD) and ev.KeyDown: yield from self._event_to_key_presses(ev) - elif type(ev) == MOUSE_EVENT_RECORD: + elif isinstance(ev, MOUSE_EVENT_RECORD): yield from self._handle_mouse(ev) @staticmethod @@ -379,7 +379,7 @@ def _event_to_key_presses(self, ev: KEY_EVENT_RECORD) -> list[KeyPress]: """ For this `KEY_EVENT_RECORD`, return a list of `KeyPress` instances. """ - assert type(ev) == KEY_EVENT_RECORD and ev.KeyDown + assert isinstance(ev, KEY_EVENT_RECORD) and ev.KeyDown result: KeyPress | None = None