Skip to content

Commit b83c4b8

Browse files
Tenzersebastinas
authored andcommitted
Fix type annotation errors raised by the latest version of mypy
1 parent 7c5b3b9 commit b83c4b8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

curtsies/input.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def __exit__(
5757
class Input(ContextManager["Input"]):
5858
"""Keypress and control event generator"""
5959

60+
in_stream: TextIO
61+
6062
def __init__(
6163
self,
6264
in_stream: Optional[TextIO] = None,
@@ -82,6 +84,7 @@ def __init__(
8284
"""
8385
if in_stream is None:
8486
in_stream = sys.__stdin__
87+
assert in_stream is not None
8588
self.in_stream = in_stream
8689
self.unprocessed_bytes: List[bytes] = [] # leftover from stdin, unprocessed yet
8790
if isinstance(keynames, str):

curtsies/window.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(
4242
logger.debug("-------initializing Window object %r------" % self)
4343
if out_stream is None:
4444
out_stream = sys.__stdout__
45+
assert out_stream is not None
4546
self.t = blessed.Terminal(stream=out_stream, force_styling=True)
4647
self.out_stream = out_stream
4748
self.hide_cursor = hide_cursor
@@ -241,10 +242,12 @@ class CursorAwareWindow(BaseWindow, ContextManager["CursorAwareWindow"]):
241242
Only use the render_to_terminal interface for moving the cursor.
242243
"""
243244

245+
in_stream: TextIO
246+
244247
def __init__(
245248
self,
246-
out_stream: Optional[IO] = None,
247-
in_stream: Optional[IO] = None,
249+
out_stream: Optional[TextIO] = None,
250+
in_stream: Optional[TextIO] = None,
248251
keep_last_line: bool = False,
249252
hide_cursor: bool = True,
250253
extra_bytes_callback: Optional[Callable[[bytes], None]] = None,
@@ -264,6 +267,7 @@ def __init__(
264267
super().__init__(out_stream=out_stream, hide_cursor=hide_cursor)
265268
if in_stream is None:
266269
in_stream = sys.__stdin__
270+
assert in_stream is not None
267271
self.in_stream = in_stream
268272
# whether we can use blessed to handle some operations
269273
self._use_blessed = (

0 commit comments

Comments
 (0)