Skip to content

Commit

Permalink
win32: fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 authored and jonathanslenders committed Nov 3, 2023
1 parent 27cb5c0 commit 4c3c063
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/prompt_toolkit/input/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4c3c063

Please sign in to comment.