Skip to content

Commit 50f260a

Browse files
committed
Fixed mypy type error
1 parent 215894d commit 50f260a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/_pyrepl/windows_console.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,10 @@ def get_event(self, block: bool = True) -> Event | None:
415415
if event is None and block:
416416
continue
417417

418-
# Queue this key event to be repeated if wRepeatCount > 1, such as when a 'dead key' is pressed twice
419-
for _ in range(rec.Event.KeyEvent.wRepeatCount - 1):
420-
self.key_repeat_queue.appendleft(event)
418+
if event is not None:
419+
# Queue this key event to be repeated if wRepeatCount > 1, such as when a 'dead key' is pressed twice
420+
for _ in range(rec.Event.KeyEvent.wRepeatCount - 1):
421+
self.key_repeat_queue.appendleft(event)
421422

422423
return event
423424

0 commit comments

Comments
 (0)